Advertisement
Braulio777

Arduino LED Matrix 1 (Happy Face)

Dec 20th, 2014
1,266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.05 KB | None | 0 0
  1. //Arduino LED Matrix 1 (Happy Face)
  2. // For MAX7219 and 8x8 LED Matrix
  3. //Let me write the coordinates of your 8x8 LED Matrix
  4. //(1,0), (2,0), (3,0), (4,0), (5,0), (6,0), (7,0), (0,0)
  5. //(1,1), (2,1), (3,1), (4,1), (5,1), (6,1), (7,1), (0,1)
  6. //(1,2), (2,2), (3,2), (4,2), (5,2), (6,2), (7,2), (0,2)
  7. //(1,3), (2,3), (3,3), (4,3), (5,3), (6,3), (7,3), (0,3)
  8. //(1,4), (2,4), (3,4), (4,4), (5,4), (6,4), (7,4), (0,4)
  9. //(1,5), (2,5), (3,5), (4,5), (5,5), (6,5), (7,5), (0,5)
  10. //(1,6), (2,6), (3,6), (4,6), (5,6), (6,6), (7,6), (0,6)
  11. //(1,7), (2,7), (3,7), (4,7), (5,7), (6,7), (7,7), (0,7)
  12. #include <Sprite.h>
  13. #include <Matrix.h>
  14. const int loadPin = A1;
  15. const int clockPin = A3;
  16. const int dataPin = A2;
  17. Matrix myMatrix = Matrix(A2, A3, A1);
  18. void setup()
  19. {}
  20. void loop()
  21. {
  22. myMatrix.clear();
  23. delay(1000);
  24. // Happy face
  25. myMatrix.write(1, 5, HIGH);
  26. myMatrix.write(2, 2, HIGH);
  27. myMatrix.write(2, 6, HIGH);
  28. myMatrix.write(3, 6, HIGH);
  29. myMatrix.write(4, 6, HIGH);
  30. myMatrix.write(5, 2, HIGH);
  31. myMatrix.write(5, 6, HIGH);
  32. myMatrix.write(6, 5, HIGH);
  33. delay(1000);
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement