daily pastebin goal
72%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 42 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <avr/pgmspace.h> // allows use of PROGMEM to store patterns in flash
  2.  
  3. #define CUBESIZE 4
  4. #define PLANESIZE CUBESIZE*CUBESIZE
  5. #define PLANETIME 3333 // time each plane is displayed in us -> 100 Hz refresh
  6. #define TIMECONST 20 // multiplies DisplayTime to get ms - why not =100?
  7.  
  8. // LED Pattern Table in PROGMEM - last column is display time in 100ms units
  9. // TODO this could be a lot more compact but not with binary pattern representation
  10. prog_uchar PROGMEM PatternTable[] = {
  11. // blink on and off
  12.  
  13. B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  14. B0011,B0000,B0000,B0000,B0011,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  15. B0011,B0010,B0000,B0000,B0011,B0010,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  16. B0011,B0011,B0000,B0000,B0011,B0011,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  17. B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  18. B0000,B0000,B0000,B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,B0000,B0000,10,
  19. B0000,B0000,B0000,B0000,B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,B0000,10,
  20. B0000,B0000,B0000,B0000,B0000,B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,10,
  21. B0000,B0000,B0000,B0000,B0000,B0000,B0011,B0011,B0000,B0000,B0011,B0011,B0000,B0000,B0000,B0000,10,
  22. B0000,B0000,B0000,B0000,B0000,B0001,B0011,B0111,B0000,B0001,B0011,B0111,B0000,B0000,B0001,B0011,10,
  23. B0000,B0000,B0000,B0000,B0000,B0011,B0111,B0111,B0000,B0011,B0111,B0111,B0000,B0001,B0011,B0111,10,
  24. B0000,B0000,B0000,B0000,B0000,B0111,B0111,B0111,B0000,B0111,B0111,B0111,B0000,B0011,B0111,B0111,10,
  25. B0000,B0000,B0000,B0000,B0000,B0111,B0111,B0111,B0000,B0111,B0111,B0111,B0000,B0111,B0111,B0111,10,
  26. B0000,B0000,B0000,B0000,B0000,B1110,B1110,B1110,B0000,B1110,B1110,B1110,B0000,B1110,B1110,B1110,10,
  27. B0000,B1110,B1110,B1110,B0000,B1110,B1110,B1110,B0000,B1110,B1110,B1110,B0000,B0000,B0000,B0000,10,
  28. B0000,B1110,B1110,B1110,B0000,B1110,B1110,B1110,B0000,B1100,B1110,B1110,B0000,B0000,B0000,B0000,10,
  29. B0000,B1110,B1110,B1110,B0000,B1100,B1110,B1110,B0000,B1000,B1100,B1110,B0000,B0000,B0000,B0000,10,
  30. B0000,B1100,B1110,B1110,B0000,B1000,B1100,B1110,B0000,B0000,B1000,B1100,B0000,B0000,B0000,B0000,10,
  31. B0000,B1000,B1100,B1110,B0000,B0000,B1000,B1100,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,10,
  32. B0000,B0000,B1000,B1100,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  33. B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  34. B0000,B0000,B1000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  35. B0000,B1000,B1000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  36. B1000,B1000,B1000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  37. B1100,B1000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  38. B1110,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  39. B1110,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  40. B0110,B0000,B0000,B0000,B0011,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  41. B0010,B0000,B0000,B0000,B0011,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  42. B0000,B0000,B0000,B0000,B0011,B0001,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  43. B0000,B0000,B0000,B0000,B0001,B0001,B0001,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  44. B0000,B0000,B0000,B0000,B0000,B0001,B0001,B0011,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  45. B0000,B0000,B0000,B0000,B0000,B0000,B0001,B0111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  46. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  47. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1110,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,10,
  48. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1100,B0000,B0000,B1000,B1000,B0000,B0000,B0000,B0000,10,
  49. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1000,B0000,B0000,B1100,B1000,B0000,B0000,B0000,B0000,10,
  50. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1110,B1000,B0000,B0000,B0000,B0000,10,
  51. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1111,B0000,B0000,B0000,B0000,B0000,10,
  52. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0001,B0111,B0000,B0000,B0000,B0000,B0000,10,
  53. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0001,B0001,B0011,B0000,B0000,B0000,B0000,B0000,10,
  54. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0001,B0001,B0001,B0000,B0001,B0000,B0000,B0000,10,
  55. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0001,B0001,B0000,B0000,B0011,B0000,B0000,B0000,10,
  56. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0111,B0000,B0000,B0000,10,
  57. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1111,B0000,B0000,B0000,10,
  58. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1110,B1000,B0000,B0000,10,
  59. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1100,B1100,B0000,B0000,10,
  60. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1000,B1110,B0000,B0000,10,
  61. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1111,B0000,B0000,10,
  62. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0111,B0000,B0000,10,
  63. B0000,B0000,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0011,B0000,B0000,10,
  64. B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,10,
  65. B0001,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0000,B0000,B0000,10,
  66. B0011,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  67. B0111,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  68. B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  69. B1111,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  70. B1111,B1100,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  71. B1111,B1110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  72. B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  73. B1111,B1111,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  74. B1111,B1111,B0011,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  75. B1111,B1111,B0111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  76. B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  77. B1111,B1111,B1111,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  78. B1111,B1111,B1111,B1100,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  79. B1111,B1111,B1111,B1110,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  80. B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  81. B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  82. B0111,B0111,B0111,B0111,B1000,B1000,B1000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  83. B0011,B0011,B0011,B0011,B0100,B0100,B0100,B0100,B1000,B1000,B1000,B1000,B0000,B0000,B0000,B0000,10,
  84. B0001,B0001,B0001,B0001,B0010,B0010,B0010,B0010,B0100,B0100,B0100,B0100,B1000,B1000,B1000,B1000,10,
  85. B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0010,B0010,B0010,B0010,B0100,B0100,B0100,B0100,10,
  86. B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0010,B0010,B0010,B0010,10,
  87. B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,10,
  88. B0010,B0001,B0001,B0001,B0010,B0001,B0001,B0001,B0010,B0001,B0001,B0001,B0010,B0001,B0001,B0001,10,
  89. B0100,B0010,B0001,B0001,B0100,B0010,B0001,B0001,B0100,B0010,B0001,B0001,B0100,B0010,B0001,B0001,10,
  90. B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
  91. B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
  92. B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
  93. B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
  94. B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,10,
  95. B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,10,
  96. B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
  97. B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
  98. B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
  99. B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
  100. B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
  101. B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
  102. B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
  103. B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
  104. B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,10,
  105. B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,10,
  106. B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
  107. B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
  108. B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
  109. B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
  110. B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
  111. B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
  112. B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
  113. B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
  114. B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,10,
  115. B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,10,
  116. B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
  117. B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
  118. B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
  119. B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
  120. B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
  121. B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
  122. B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
  123. B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
  124. B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,10,
  125. B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,10,
  126. B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
  127. B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
  128. B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
  129. B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
  130. B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
  131. B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
  132. B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
  133. B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
  134. B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,10,
  135. B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,10,
  136. B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
  137. B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
  138. B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
  139. B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
  140. B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
  141. B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
  142. B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
  143. B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
  144. B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,10,
  145. B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,B0100,B0100,B0010,B0010,10,
  146. B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,B1000,B0100,B0010,B0001,10,
  147. B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,B0000,B1100,B0011,B0000,10,
  148. B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,B0000,B0011,B1100,B0000,10,
  149. B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
  150. B0000,B0010,B0100,B0000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
  151. B0000,B0000,B0000,B0000,B0000,B0010,B0100,B0000,B0001,B0010,B0100,B1000,B0001,B0010,B0100,B1000,10,
  152. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0010,B0100,B0000,B0001,B0010,B0100,B1000,10,
  153. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0010,B0100,B0000,10,
  154. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  155. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1000,10,
  156. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1000,B0000,B0010,B0000,B1000,10,
  157. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1000,B0000,B0010,B0000,B1000,B0000,B0010,B1000,B0000,10,
  158. B0000,B0000,B0000,B1000,B0000,B0010,B0000,B1000,B0000,B0010,B1000,B0000,B0000,B0000,B1000,B0000,10,
  159. B0000,B0010,B0000,B1000,B0000,B0010,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,B0000,10,
  160. B0000,B0010,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  161. B0000,B0000,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  162. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  163. B0000,B0100,B0010,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  164. B0000,B0110,B0110,B0000,B0000,B0100,B0010,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  165. B1001,B0110,B0110,B1001,B0000,B0110,B0110,B0000,B0000,B0100,B0010,B0000,B0000,B0000,B0000,B0000,10,
  166. B1101,B0111,B1110,B1011,B1001,B0110,B0110,B1001,B0000,B0110,B0110,B0000,B0000,B0100,B0010,B0000,10,
  167. B1111,B1111,B1111,B1111,B1101,B0111,B1110,B1011,B1001,B0110,B0110,B1001,B0000,B0110,B0110,B0000,10,
  168. B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1101,B0111,B1110,B1011,B1001,B0110,B0110,B1001,10,
  169. B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1101,B0111,B1110,B1011,10,
  170. B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,10,
  171. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  172. B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,10,
  173. B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,10,
  174. B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  175. B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  176. B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  177.  
  178. //Back and forth
  179. B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,10,
  180. B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,10,
  181. B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,10,
  182. B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,10,
  183. B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,10,
  184. B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,10,
  185. B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,10,
  186. B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,10,
  187. B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,10,
  188. B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,10,
  189. B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,10,
  190. B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,10,
  191. B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,10,
  192. B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,10,
  193. B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,10,
  194. B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,10,
  195. B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,B0100,10,
  196. B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,B0010,10,
  197.  
  198. //fill from right
  199. B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,10,
  200. B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,10,
  201. B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,10,
  202. B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,10,
  203. B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,10,
  204. B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,10,
  205. B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,10,
  206. B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,10,
  207. B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,10,
  208. B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,10,
  209. B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,10,
  210. B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,10,
  211. B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,10,
  212. B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,10,
  213. B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,10,
  214. B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,10,
  215. B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,10,
  216. B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,10,
  217.  
  218. //fill from left
  219. B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,B0001,10,
  220. B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,B0011,10,
  221. B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,B0111,10,
  222. B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,10,
  223. B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,10,
  224. B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,10,
  225. B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,10,
  226. B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,10,
  227. B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,10,
  228. B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,10,
  229. B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,10,
  230. B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,10,
  231. B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,10,
  232. B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,10,
  233. B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,10,
  234. B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,10,
  235. B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,10,
  236. B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,10,
  237. B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,B1000,10,
  238. B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,B1100,10,
  239. B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,B1110,10,
  240. B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,10,
  241.  
  242. //X shape
  243. B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,10,
  244. B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,10,
  245. B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,10,
  246. B0000,B0000,B0000,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B1000,10,
  247. B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,10,
  248. B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,10,
  249. B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,10,
  250. B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,10,
  251. B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,10,
  252. B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,10,
  253. B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,10,
  254. B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,10,
  255. B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,10,
  256. B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,10,
  257. B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,10,
  258. B0000,B0000,B0000,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B1000,10,
  259. B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,10,
  260. B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,10,
  261. B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,10,
  262. B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,10,
  263. B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,10,
  264. B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,10,
  265. B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,B0100,B0000,B0000,B0000,10,
  266. B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0010,B0000,B0000,B0000,10,
  267.  
  268. //Diagonaly fill cube
  269. B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,10,
  270. B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  271. B0001,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  272. B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  273. B0001,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  274. B0001,B0001,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  275. B0001,B0001,B0001,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  276. B0011,B0011,B0011,B0011,B0001,B0001,B0001,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  277. B0111,B0111,B0111,B0111,B0011,B0011,B0011,B0011,B0001,B0001,B0001,B0001,B0000,B0000,B0000,B0000,10,
  278. B1111,B1111,B1111,B1111,B0111,B0111,B0111,B0111,B0011,B0011,B0011,B0011,B0001,B0001,B0001,B0001,10,
  279. B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0111,B0111,B0111,B0111,B0011,B0011,B0011,B0011,10,
  280. B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0111,B0111,B0111,B0111,10,
  281. B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,10,
  282. B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0111,B0111,B0111,B0111,10,
  283. B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0111,B0111,B0111,B0111,B0011,B0011,B0011,B0011,10,
  284. B1111,B1111,B1111,B1111,B0111,B0111,B0111,B0111,B0011,B0011,B0011,B0011,B0001,B0001,B0001,B0001,10,
  285. B0111,B0111,B0111,B0111,B0011,B0011,B0011,B0011,B0001,B0001,B0001,B0001,B0000,B0000,B0000,B0000,10,
  286. B0011,B0011,B0011,B0011,B0001,B0001,B0001,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  287. B0001,B0001,B0001,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  288. B0011,B0011,B0011,B0011,B0001,B0001,B0001,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  289. B0111,B0111,B0111,B0111,B0011,B0011,B0011,B0011,B0001,B0001,B0001,B0001,B0000,B0000,B0000,B0000,10,
  290. B1111,B1111,B1111,B1111,B0111,B0111,B0111,B0111,B0011,B0011,B0011,B0011,B0001,B0001,B0001,B0001,10,
  291. B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0111,B0111,B0111,B0111,B0011,B0011,B0011,B0011,10,
  292. B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0111,B0111,B0111,B0111,10,
  293. B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,10,
  294. B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0111,B0111,B0111,B0111,10,
  295. B1111,B1111,B1111,B1111,B1111,B1111,B1111,B1111,B0111,B0111,B0111,B0111,B0011,B0011,B0011,B0011,10,
  296. B1111,B1111,B1111,B1111,B0111,B0111,B0111,B0111,B0011,B0011,B0011,B0011,B0001,B0001,B0001,B0001,10,
  297. B0111,B0111,B0111,B0111,B0011,B0011,B0011,B0011,B0001,B0001,B0001,B0001,B0000,B0000,B0000,B0000,10,
  298. B0011,B0011,B0011,B0011,B0001,B0001,B0001,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  299. B0001,B0001,B0001,B0001,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,10,
  300.  
  301. B1111,B1001,B1001,B1111,B1001,B0000,B0000,B1001,B1001,B0000,B0000,B1001,B1111,B1001,B1001,B1111,10,
  302. B0000,B0000,B0000,B000,B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,B0000,10,
  303. B1111,B1001,B1001,B1111,B1001,B0000,B0000,B1001,B1001,B0000,B0000,B1001,B1111,B1001,B1001,B1111,10,
  304. B0000,B0000,B0000,B000,B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,B0000,10,
  305. B1111,B1001,B1001,B1111,B1001,B0000,B0000,B1001,B1001,B0000,B0000,B1001,B1111,B1001,B1001,B1111,10,
  306. B0000,B0000,B0000,B000,B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,B0000,10,
  307. B1111,B1001,B1001,B1111,B1001,B0000,B0000,B1001,B1001,B0000,B0000,B1001,B1111,B1001,B1001,B1111,10,
  308. B0000,B0000,B0000,B000,B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,B0000,10,
  309. B1111,B1001,B1001,B1111,B1001,B0000,B0000,B1001,B1001,B0000,B0000,B1001,B1111,B1001,B1001,B1111,10,
  310. B0000,B0000,B0000,B000,B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,B0000,10,
  311. B1111,B1001,B1001,B1111,B1001,B0000,B0000,B1001,B1001,B0000,B0000,B1001,B1111,B1001,B1001,B1111,10,
  312. B0000,B0000,B0000,B000,B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,B0000,10,
  313. B1111,B1001,B1001,B1111,B1001,B0000,B0000,B1001,B1001,B0000,B0000,B1001,B1111,B1001,B1001,B1111,10,
  314. B0000,B0000,B0000,B000,B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,B0000,10,
  315. B1111,B1001,B1001,B1111,B1001,B0000,B0000,B1001,B1001,B0000,B0000,B1001,B1111,B1001,B1001,B1111,10,
  316. B0000,B0000,B0000,B000,B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,B0000,10,
  317. B1111,B1001,B1001,B1111,B1001,B0000,B0000,B1001,B1001,B0000,B0000,B1001,B1111,B1001,B1001,B1111,10,
  318. B0000,B0000,B0000,B000,B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,B0000,10,
  319. B1111,B1001,B1001,B1111,B1001,B0000,B0000,B1001,B1001,B0000,B0000,B1001,B1111,B1001,B1001,B1111,10,
  320. B0000,B0000,B0000,B000,B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,B0000,10,
  321. B1111,B1001,B1001,B1111,B1001,B0000,B0000,B1001,B1001,B0000,B0000,B1001,B1111,B1001,B1001,B1111,10,
  322. B0000,B0000,B0000,B000,B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,B0000,10,
  323. B1111,B1001,B1001,B1111,B1001,B0000,B0000,B1001,B1001,B0000,B0000,B1001,B1111,B1001,B1001,B1111,10,
  324. B0000,B0000,B0000,B000,B0000,B0110,B0110,B0000,B0000,B0110,B0110,B0000,B0000,B0000,B0000,B0000,10,
  325. B1111,B1001,B1001,B1111,B1001,B0000,B0000,B1001,B1001,B0000,B0000,B1001,B1111,B1001,B1001,B1111,10,
  326.  
  327. B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0001,B1111,B1111,B1111,B1111,10,
  328. B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0001,B0000,B0000,B0000,B0000,B1111,B1111,B1111,B1111,10,
  329. B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1111,B1111,B1111,B1111,10,
  330. B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0100,B0000,B1111,B1111,B1111,B1111,10,
  331. B1111,B1111,B1111,B1111,B0000,B0000,B0100,B0000,B0000,B0000,B0000,B0000,B1111,B1111,B1111,B1111,10,
  332. B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1111,B1111,B1111,B1111,10,
  333. B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0100,B0000,B0000,B1111,B1111,B1111,B1111,10,
  334. B1111,B1111,B1111,B1111,B0000,B0100,B0000,B0000,B0000,B0000,B0000,B0000,B1111,B1111,B1111,B1111,10,
  335. B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1111,B1111,B1111,B1111,10,
  336. B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0001,B0000,B1111,B1111,B1111,B1111,10,
  337. B1111,B1111,B1111,B1111,B0000,B0000,B0001,B0000,B0000,B0000,B0000,B0000,B1111,B1111,B1111,B1111,10,
  338. B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1111,B1111,B1111,B1111,10,
  339. B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B1111,B1111,B1111,B1111,10,
  340. B1111,B1111,B1111,B1111,B1000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1111,B1111,B1111,B1111,10,
  341. B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1111,B1111,B1111,B1111,10,
  342. B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0010,B1111,B1111,B1111,B1111,10,
  343. B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0010,B0000,B0000,B0000,B0000,B1111,B1111,B1111,B1111,10,
  344. B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1111,B1111,B1111,B1111,10,
  345. B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1000,B1111,B1111,B1111,B1111,10,
  346. B1111,B1111,B1111,B1111,B0000,B0000,B0000,B1000,B0000,B0000,B0000,B0000,B1111,B1111,B1111,B1111,10,
  347. B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1111,B1111,B1111,B1111,10,
  348. B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0100,B0000,B0000,B1111,B1111,B1111,B1111,10,
  349. B1111,B1111,B1111,B1111,B0000,B0100,B0000,B0000,B0000,B0000,B0000,B0000,B1111,B1111,B1111,B1111,10,
  350. B1111,B1111,B1111,B1111,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B0000,B1111,B1111,B1111,B1111,10,
  351.  
  352. // this is a dummy element for end of table (duration=0) aka !!!DO NOT TOUCH!!!
  353. B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, 0
  354. };
  355.  
  356. /*
  357. ** Defining pins in array makes it easier to rearrange how cube is wired
  358. ** Adjust numbers here until LEDs flash in order - L to R, T to B
  359. ** Note that analog inputs 0-5 are also digital outputs 14-19!
  360. ** Pin DigitalOut0 (serial RX) and AnalogIn5 are left open for future apps
  361. */
  362.  
  363. int LEDPin[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
  364. int PlanePin[] = {16, 17, 18, 19};
  365.  
  366. // initialization
  367. void setup()
  368. {
  369. int pin; // loop counter
  370. // set up LED pins as output (active HIGH)
  371. for (pin=0; pin<PLANESIZE; pin++) {
  372. pinMode( LEDPin[pin], OUTPUT );
  373. }
  374. // set up plane pins as outputs (active LOW)
  375. for (pin=0; pin<CUBESIZE; pin++) {
  376. pinMode( PlanePin[pin], OUTPUT );
  377. }
  378. }
  379.  
  380. // display pattern in table until DisplayTime is zero (then repeat)
  381. void loop()
  382. {
  383. // declare variables
  384. byte PatternBuf[PLANESIZE]; // saves current pattern from PatternTable
  385. int PatternIdx;
  386. byte DisplayTime; // time*100ms to display pattern
  387. unsigned long EndTime;
  388. int plane; // loop counter for cube refresh
  389. int patbufidx; // indexes which byte from pattern buffer
  390. int ledrow; // counts LEDs in refresh loop
  391. int ledcol; // counts LEDs in refresh loop
  392. int ledpin; // counts LEDs in refresh loop
  393.  
  394. // Initialize PatternIdx to beginning of pattern table
  395. PatternIdx = 0;
  396. // loop over entries in pattern table - while DisplayTime>0
  397. do {
  398. // read pattern from PROGMEM and save in array
  399. memcpy_P( PatternBuf, PatternTable+PatternIdx, PLANESIZE );
  400. PatternIdx += PLANESIZE;
  401. // read DisplayTime from PROGMEM and increment index
  402. DisplayTime = pgm_read_byte_near( PatternTable + PatternIdx++ );
  403. // compute EndTime from current time (ms) and DisplayTime
  404. EndTime = millis() + ((unsigned long) DisplayTime) * TIMECONST;
  405.  
  406. // loop while DisplayTime>0 and current time < EndTime
  407. while ( millis() < EndTime ) {
  408. patbufidx = 0; // reset index counter to beginning of buffer
  409. // loop over planes
  410. for (plane=0; plane<CUBESIZE; plane++) {
  411. // turn previous plane off
  412. if (plane==0) {
  413. digitalWrite( PlanePin[CUBESIZE-1], HIGH );
  414. } else {
  415. digitalWrite( PlanePin[plane-1], HIGH );
  416. }
  417.  
  418. // load current plane pattern data into ports
  419. ledpin = 0;
  420. for (ledrow=0; ledrow<CUBESIZE; ledrow++) {
  421. for (ledcol=0; ledcol<CUBESIZE; ledcol++) {
  422. digitalWrite( LEDPin[ledpin++], PatternBuf[patbufidx] & (1 << ledcol) );
  423. }
  424. patbufidx++;
  425. }
  426.  
  427. // turn current plane on
  428. digitalWrite( PlanePin[plane], LOW );
  429. // delay PLANETIME us
  430. delayMicroseconds( PLANETIME );
  431. } // for plane
  432. } // while <EndTime
  433. } while (DisplayTime > 0); // read patterns until time=0 which signals end
  434. }
RAW Paste Data
Top