evenjc

Untitled

Sep 29th, 2020
947
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from sense_hat import SenseHat
  2. from time import sleep
  3.  
  4.  
  5. senseHat = SenseHat()
  6. senseHat.clear()
  7.  
  8.  
  9. X = [255, 0, 0]  # Red
  10. O = [255, 255, 255]  # White
  11.  
  12. heart = [
  13. O, X, X, O, O, X, X, O,
  14. X, X, X, X, X, X, X, X,
  15. X, X, X, X, X, X, X, X,
  16. X, X, X, X, X, X, X, X,
  17. O, X, X, X, X, X, X, O,
  18. O, X, X, X, X, X, X, O,
  19. O, O, X, X, X, X, O, O,
  20. O, O, O, X, X, O, O, O
  21. ]
  22. while X[0] > 50:
  23.   print(X[0])
  24.   senseHat.set_pixels(heart)
  25.   X[0] -= 25
  26.   sleep(1)
  27.  
  28. while X[0] <= 50:
  29.   print(X[0])
  30.   X = [255, 0, 0]
  31.   senseHat.set_pixels(heart)
RAW Paste Data