- Open App โ New App.
- Tap + Add Widget and choose Switch.
- Tap the Switch: in its code you see on โ send "S" and off โ send "s".
- Put the board code below on your TinkerPy board.
- Tap Run, then Connect โ Bluetooth, and flip your switch!
This is the board side โ it listens for S and s:
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(): bt = bluetooth_read_char() if bt == 'S': write_output(o1, pwm(100)) elif bt == 's': write_output(o1, 0)