Advertisement
Guest User

Untitled

a guest
Jul 30th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. from microbit import *
  2.  
  3. cur_image_pos = 0
  4.  
  5. def checkinput():
  6. global cur_image_pos
  7. sleep(100)
  8. if button_a.get_presses() > 0 and cur_image_pos > 0 :
  9. cur_image_pos = cur_image_pos - 1
  10. if button_b.get_presses() > 0 and cur_image_pos < len(imagelist) - 1:
  11. cur_image_pos = cur_image_pos + 1
  12. display.show(imagelist[cur_image_pos])
  13.  
  14. angry = Image("90009:"
  15. "09090:"
  16. "09090:"
  17. "00900:"
  18. "99999")
  19. imagelist = [angry, Image.ANGRY, Image.SKULL, Image.COW, Image.PACMAN,
  20. Image.GHOST, Image.SWORD, Image.SNAKE]
  21.  
  22. while True:
  23. #display.scroll('Hello, World!')
  24. #display.show(angry)
  25. checkinput()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement