Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #PLAYER
- from microbit import *
- import radio
- radio.on()
- radio.config(channel=30)
- # display.off()
- POSITION_1 = '1'
- POSITION_2 = '2'
- POSITION_3 = '3'
- POSITION_4 = '4'
- #change pins based on wiring
- def send_position():
- if pin0.read_digital():
- radio.send(POSITION_1)
- display.show("1")
- sleep(500)
- if pin1.read_digital():
- radio.send(POSITION_2)
- display.show("2")
- sleep(500)
- if pin2.read_digital():
- radio.send(POSITION_3)
- display.show("3")
- sleep(500)
- display.clear()
- """
- if pin3.read_digital():
- radio.send(POSITION_4)
- """
- while True:
- send_position()
Add Comment
Please, Sign In to add comment