Demo example script Prints the temperature from the shield's LMT84 sensor once a second, with the green LED lit while it runs. The LED goes off again when the script is stopped.
- Connect
- JP3 (VIO) on 3.3 V, JP4 on 5 V, JP1 on INT and JP2 on EXT (A3). With JP2 on INT, use set_output_pin("A0").
- Uses
- set_output_pin(), temperature(), green_led; mcu.analog_averaging()
import time
import analog_shield as shield
import phyduino as mcu
shield.set_output_pin("A3")
mcu.analog_averaging(16)
shield.green_led.on()
try:
while True:
print("%.1f C" % shield.temperature())
time.sleep(1)
finally:
shield.green_led.off()