- Add the Fire widget (in Output โ Safety & Alarms).
- Its code says: when the board sends A โ show FIRE; a โ SAFE.
- Optional: tap Sound โ Speaker to play a siren on fire!
- Put the board code below on your board with a flame sensor on i2.
Board code
Put this on your TinkerPy board with TinkerPy Projects:
from tinkerpy_mega import * from bluetooth import * def setup(): bluetooth_begin() # switches Bluetooth on when the board starts def loop(): if read_digital(i2) == ON: bluetooth_write("A") write_output(o1, pwm(100)) else: bluetooth_write("a") write_output(o1, 0) wait(500)