Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
projects:mpu [2020/08/22 16:05]
127.0.0.1 external edit
projects:mpu [2023/07/31 18:36] (current)
darron [Examples]
Line 5: Line 5:
 </wrap> </wrap>
  
-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 or network address and displays any output from the device.
  
 === Install === === Install ===
Line 48: Line 48:
 </code> </code>
  
-==ESP8266==+==Temperature==
  
-BMP180 attached to ESP8266 as per picture above.+BMP180 attached to ESP8266 as per pictured above.
  
 <code> <code>
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, 0xF4, bytearray([0x2E])) bus.writeto_mem(119, 0xF4, bytearray([0x2E]))
 +
 +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".format(T))
 </code> </code>
  
Line 103: Line 106:
  
 <code> <code>
-29.4593+29.4593 degrees centigrade
 </code> </code>