KRITSADA

Radio send ligt level python micmrobit

Oct 28th, 2019
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from microbit import *
  2. import radio
  3.  
  4. radio.on()
  5. radio.config(channel = 42)
  6. radio.config(power=7)
  7.  
  8. while True:
  9.     light_level = pin0.read_analog() / 10
  10.     message = "3, {}".format(light_level)
  11.     radio.send(message)
  12.     sleep(1000)
Add Comment
Please, Sign In to add comment