Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. import microbit as m
  2.  
  3. SUN_IMAGE = m.Image(
  4. "90909\n"
  5. "09990\n"
  6. "99999\n"
  7. "09990\n"
  8. "90909")
  9. MOON_IMAGE = m.Image(
  10. "99900\n"
  11. "09990\n"
  12. "00990\n"
  13. "09990\n"
  14. "99900")
  15.  
  16. while True:
  17. light = m.pin0.read_analog()
  18.  
  19. if light > 512:
  20. m.display.show(SUN_IMAGE)
  21. else:
  22. m.display.show(MOON_IMAGE)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement