Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import radio
- import random
- from microbit import *
- active_alert = False
- recieved_good = [Image.YES]
- radio.on()
- while True:
- if button_a.was_pressed():
- active_alert = True
- radio.send("alert")
- if button_b.was_pressed():
- active_alert = False
- if active_alert:
- incoming = radio.receive()
- if incoming is not None and "student_" in incoming:
- with open('students_info.txt', 'w') as students:
- students.write(incoming)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement