Advertisement
Guest User

Untitled

a guest
Jan 19th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. import radio
  2. import random
  3. from microbit import *
  4.  
  5. active_alert = False
  6. recieved_good = [Image.YES]
  7.  
  8. radio.on()
  9.  
  10. while True:
  11. if button_a.was_pressed():
  12. active_alert = True
  13. radio.send("alert")
  14. if button_b.was_pressed():
  15. active_alert = False
  16. if active_alert:
  17. incoming = radio.receive()
  18. if incoming is not None and "student_" in incoming:
  19. with open('students_info.txt', 'w') as students:
  20. students.write(incoming)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement