Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
projects:mpu [2020/08/22 16:05] – external edit 127.0.0.1 | projects:mpu [2023/07/31 18:36] (current) – [Examples] darron | ||
---|---|---|---|
Line 5: | Line 5: | ||
</ | </ | ||
- | This utility works like a shell interpreter but pastes the content of a script into a MicroPython device on a local UART interface and displays any output from the device. | + | This utility works like a shell interpreter but pastes the content of a script into a MicroPython device on a local UART interface |
=== Install === | === Install === | ||
Line 48: | Line 48: | ||
</ | </ | ||
- | ==ESP8266== | + | ==Temperature== |
- | BMP180 attached to ESP8266 as per picture | + | BMP180 attached to ESP8266 as per pictured |
< | < | ||
Line 56: | Line 56: | ||
import sys | import sys | ||
+ | import time | ||
from machine import Pin, I2C | from machine import Pin, I2C | ||
from ustruct import unpack | from ustruct import unpack | ||
Line 90: | Line 91: | ||
bus.writeto_mem(119, | bus.writeto_mem(119, | ||
+ | |||
+ | time.sleep_ms(5) | ||
UT = read(0xF6) | UT = read(0xF6) | ||
Line 97: | Line 100: | ||
T = ((B5 + 8) / 16) / 10 | T = ((B5 + 8) / 16) / 10 | ||
- | print (T) | + | print ("{} degrees centigrade" |
</ | </ | ||
Line 103: | Line 106: | ||
< | < | ||
- | 29.4593 | + | 29.4593 |
</ | </ | ||