Advertisement
aidanquayle

Finished Sketch ver. 1.0

Dec 31st, 2013
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.68 KB | None | 0 0
  1.  
  2. const int sensorPin = 4;
  3. int sensorState;
  4. int lastSensorState = LOW;
  5. long lastDebounceTime = 0;
  6. long debounceDelay = 50;
  7.  
  8. #include "SPI.h"
  9. #include "DMD.h"
  10. #include "TimerOne.h"
  11. #define DISPLAYS_ACROSS 1
  12. #define DISPLAYS_DOWN 1
  13. DMD dmd(DISPLAYS_ACROSS,DISPLAYS_DOWN);
  14.  
  15.  
  16.  
  17. void ScanDMD()
  18. {
  19. dmd.scanDisplayBySPI();
  20. }
  21.  
  22.  
  23. void setup()
  24. {
  25. pinMode(sensorPin, INPUT);
  26. digitalWrite(sensorPin, HIGH);
  27. Timer1.initialize( 5000 );
  28. Timer1.attachInterrupt( ScanDMD );
  29. dmd.clearScreen( true );
  30. }
  31.  
  32.  
  33. void loop()
  34. {
  35. int reading = digitalRead(sensorPin);
  36. if (reading != lastSensorState)
  37. {
  38. lastDebounceTime = millis();
  39. }
  40. if ((millis() - lastDebounceTime) > debounceDelay)
  41. {
  42. if (reading != sensorState)
  43. {
  44. sensorState = reading;
  45. {
  46. eyeSetup();
  47. }
  48. }
  49. }
  50. lastSensorState = reading;
  51. }
  52.  
  53.  
  54. void eyeSetup()
  55. {
  56. if (sensorState == HIGH)
  57. {
  58. eyeBlink();
  59. }
  60. else
  61. {
  62. eyeStare();
  63. }
  64. }
  65.  
  66.  
  67. void eyeBlink()
  68. {
  69. static int count = 0;
  70. if (count > 0)
  71. {
  72. dmd.clearScreen(true); //Nearly Open
  73. dmd.drawLine(12,2,18,2, GRAPHICS_NORMAL); //Outline
  74. dmd.drawLine(8,3,12,3, GRAPHICS_NORMAL);
  75. dmd.drawLine(18,3,22,3, GRAPHICS_NORMAL);
  76. dmd.drawLine(5,4,8,4, GRAPHICS_NORMAL);
  77. dmd.drawLine(22,4,25,4, GRAPHICS_NORMAL);
  78. dmd.drawLine(3,5,5,5, GRAPHICS_NORMAL);
  79. dmd.drawLine(25,5,27,5, GRAPHICS_NORMAL);
  80. dmd.drawLine(2,6,3,6, GRAPHICS_NORMAL);
  81. dmd.drawLine(27,6,28,6, GRAPHICS_NORMAL);
  82. dmd.writePixel(2,7, GRAPHICS_NORMAL, 1);
  83. dmd.writePixel(28,7, GRAPHICS_NORMAL, 1);
  84. dmd.drawLine(2,8,3,8, GRAPHICS_NORMAL);
  85. dmd.drawLine(27,8,28,8, GRAPHICS_NORMAL);
  86. dmd.drawLine(3,9,5,9, GRAPHICS_NORMAL);
  87. dmd.drawLine(25,9,27,9, GRAPHICS_NORMAL);
  88. dmd.drawLine(6,10,8,10, GRAPHICS_NORMAL);
  89. dmd.drawLine(22,10,25,10, GRAPHICS_NORMAL);
  90. dmd.drawLine(8,11,12,11, GRAPHICS_NORMAL);
  91. dmd.drawLine(18,11,22,11, GRAPHICS_NORMAL);
  92. dmd.drawLine(12,12,18,12, GRAPHICS_NORMAL);
  93. dmd.drawLine(14,3,16,3, GRAPHICS_NORMAL); //Circle
  94. dmd.drawLine(14,11,16,11, GRAPHICS_NORMAL);
  95. dmd.drawLine(11,6,11,8, GRAPHICS_NORMAL);
  96. dmd.drawLine(19,6,19,8, GRAPHICS_NORMAL);
  97. dmd.drawLine(12,5,13,4, GRAPHICS_NORMAL);
  98. dmd.drawLine(17,4,18,5, GRAPHICS_NORMAL);
  99. dmd.drawLine(18,9,17,10, GRAPHICS_NORMAL);
  100. dmd.drawLine(13,10,12,9, GRAPHICS_NORMAL);
  101. dmd.drawFilledBox(14,6,16,8, GRAPHICS_NORMAL); //Pupil
  102. dmd.writePixel(15,5, GRAPHICS_NORMAL, 1);
  103. dmd.writePixel(15,9, GRAPHICS_NORMAL, 1);
  104. delay(40);
  105.  
  106. dmd.clearScreen(true); //Nearly Shut
  107. dmd.drawLine(7,4,23,4, GRAPHICS_NORMAL); //Outline
  108. dmd.drawLine(4,5,7,5, GRAPHICS_NORMAL);
  109. dmd.drawLine(23,5,26,5, GRAPHICS_NORMAL);
  110. dmd.drawLine(2,6,4,6, GRAPHICS_NORMAL);
  111. dmd.drawLine(26,6,28,6, GRAPHICS_NORMAL);
  112. dmd.writePixel(2,7, GRAPHICS_NORMAL, 1);
  113. dmd.writePixel(28,7, GRAPHICS_NORMAL, 1);
  114. dmd.drawLine(2,8,4,8, GRAPHICS_NORMAL);
  115. dmd.drawLine(26,8,28,8, GRAPHICS_NORMAL);
  116. dmd.drawLine(4,9,7,9, GRAPHICS_NORMAL);
  117. dmd.drawLine(23,9,26,9, GRAPHICS_NORMAL);
  118. dmd.drawLine(7,10,23,10, GRAPHICS_NORMAL);
  119. dmd.drawLine(11,6,11,8, GRAPHICS_NORMAL); //Circle
  120. dmd.drawLine(19,6,19,8, GRAPHICS_NORMAL);
  121. dmd.drawLine(12,5,13,4, GRAPHICS_NORMAL);
  122. dmd.drawLine(17,4,18,5, GRAPHICS_NORMAL);
  123. dmd.drawLine(18,9,17,10, GRAPHICS_NORMAL);
  124. dmd.drawLine(13,10,12,9, GRAPHICS_NORMAL);
  125. dmd.drawFilledBox(14,6,16,8, GRAPHICS_NORMAL); //Pupil
  126. dmd.writePixel(15,5, GRAPHICS_NORMAL, 1);
  127. dmd.writePixel(15,9, GRAPHICS_NORMAL, 1);
  128. delay(40);
  129.  
  130. dmd.clearScreen(true); //Shut
  131. dmd.drawFilledBox(4,6,26,8, GRAPHICS_NORMAL); //Outline
  132. dmd.drawBox(13,5,17,9, GRAPHICS_NORMAL);
  133. dmd.drawLine(2,7,28,7, GRAPHICS_NORMAL);
  134. }
  135. else
  136. {
  137. eyeStartupSequence();
  138. }
  139. count ++;
  140. }
  141.  
  142.  
  143. void eyeStare()
  144. {
  145. dmd.clearScreen(true); //Nearly Shut
  146. dmd.drawLine(7,4,23,4, GRAPHICS_NORMAL); //Outline
  147. dmd.drawLine(4,5,7,5, GRAPHICS_NORMAL);
  148. dmd.drawLine(23,5,26,5, GRAPHICS_NORMAL);
  149. dmd.drawLine(2,6,4,6, GRAPHICS_NORMAL);
  150. dmd.drawLine(26,6,28,6, GRAPHICS_NORMAL);
  151. dmd.writePixel(2,7, GRAPHICS_NORMAL, 1);
  152. dmd.writePixel(28,7, GRAPHICS_NORMAL, 1);
  153. dmd.drawLine(2,8,4,8, GRAPHICS_NORMAL);
  154. dmd.drawLine(26,8,28,8, GRAPHICS_NORMAL);
  155. dmd.drawLine(4,9,7,9, GRAPHICS_NORMAL);
  156. dmd.drawLine(23,9,26,9, GRAPHICS_NORMAL);
  157. dmd.drawLine(7,10,23,10, GRAPHICS_NORMAL);
  158. dmd.drawLine(11,6,11,8, GRAPHICS_NORMAL); //Circle
  159. dmd.drawLine(19,6,19,8, GRAPHICS_NORMAL);
  160. dmd.drawLine(12,5,13,4, GRAPHICS_NORMAL);
  161. dmd.drawLine(17,4,18,5, GRAPHICS_NORMAL);
  162. dmd.drawLine(18,9,17,10, GRAPHICS_NORMAL);
  163. dmd.drawLine(13,10,12,9, GRAPHICS_NORMAL);
  164. dmd.drawFilledBox(14,6,16,8, GRAPHICS_NORMAL); //Pupil
  165. dmd.writePixel(15,5, GRAPHICS_NORMAL, 1);
  166. dmd.writePixel(15,9, GRAPHICS_NORMAL, 1);
  167. delay(40);
  168.  
  169. dmd.clearScreen(true); //Nearly Open
  170. dmd.drawLine(12,2,18,2, GRAPHICS_NORMAL); //Outline
  171. dmd.drawLine(8,3,12,3, GRAPHICS_NORMAL);
  172. dmd.drawLine(18,3,22,3, GRAPHICS_NORMAL);
  173. dmd.drawLine(5,4,8,4, GRAPHICS_NORMAL);
  174. dmd.drawLine(22,4,25,4, GRAPHICS_NORMAL);
  175. dmd.drawLine(3,5,5,5, GRAPHICS_NORMAL);
  176. dmd.drawLine(25,5,27,5, GRAPHICS_NORMAL);
  177. dmd.drawLine(2,6,3,6, GRAPHICS_NORMAL);
  178. dmd.drawLine(27,6,28,6, GRAPHICS_NORMAL);
  179. dmd.writePixel(2,7, GRAPHICS_NORMAL, 1);
  180. dmd.writePixel(28,7, GRAPHICS_NORMAL, 1);
  181. dmd.drawLine(2,8,3,8, GRAPHICS_NORMAL);
  182. dmd.drawLine(27,8,28,8, GRAPHICS_NORMAL);
  183. dmd.drawLine(3,9,5,9, GRAPHICS_NORMAL);
  184. dmd.drawLine(25,9,27,9, GRAPHICS_NORMAL);
  185. dmd.drawLine(6,10,8,10, GRAPHICS_NORMAL);
  186. dmd.drawLine(22,10,25,10, GRAPHICS_NORMAL);
  187. dmd.drawLine(8,11,12,11, GRAPHICS_NORMAL);
  188. dmd.drawLine(18,11,22,11, GRAPHICS_NORMAL);
  189. dmd.drawLine(12,12,18,12, GRAPHICS_NORMAL);
  190. dmd.drawLine(14,3,16,3, GRAPHICS_NORMAL); //Circle
  191. dmd.drawLine(14,11,16,11, GRAPHICS_NORMAL);
  192. dmd.drawLine(11,6,11,8, GRAPHICS_NORMAL);
  193. dmd.drawLine(19,6,19,8, GRAPHICS_NORMAL);
  194. dmd.drawLine(12,5,13,4, GRAPHICS_NORMAL);
  195. dmd.drawLine(17,4,18,5, GRAPHICS_NORMAL);
  196. dmd.drawLine(18,9,17,10, GRAPHICS_NORMAL);
  197. dmd.drawLine(13,10,12,9, GRAPHICS_NORMAL);
  198. dmd.drawFilledBox(14,6,16,8, GRAPHICS_NORMAL); //Pupil
  199. dmd.writePixel(15,5, GRAPHICS_NORMAL, 1);
  200. dmd.writePixel(15,9, GRAPHICS_NORMAL, 1);
  201. delay(40);
  202.  
  203. dmd.clearScreen(true); //Open
  204. dmd.drawLine(13,0,17,0, GRAPHICS_NORMAL); //Outline
  205. dmd.drawLine(10,1,13,1, GRAPHICS_NORMAL);
  206. dmd.drawLine(17,1,20,1, GRAPHICS_NORMAL);
  207. dmd.drawLine(8,2,10,2, GRAPHICS_NORMAL);
  208. dmd.drawLine(20,2,22,2, GRAPHICS_NORMAL);
  209. dmd.drawLine(6,3,8,3, GRAPHICS_NORMAL);
  210. dmd.drawLine(22,3,24,3, GRAPHICS_NORMAL);
  211. dmd.drawLine(4,4,6,4, GRAPHICS_NORMAL);
  212. dmd.drawLine(24,4,26,4, GRAPHICS_NORMAL);
  213. dmd.drawLine(3,5,4,5, GRAPHICS_NORMAL);
  214. dmd.drawLine(26,5,27,5, GRAPHICS_NORMAL);
  215. dmd.drawLine(2,6,3,6, GRAPHICS_NORMAL);
  216. dmd.drawLine(27,6,28,6, GRAPHICS_NORMAL);
  217. dmd.writePixel(2,7, GRAPHICS_NORMAL, 1);
  218. dmd.writePixel(28,7, GRAPHICS_NORMAL, 1);
  219. dmd.drawLine(2,8,3,8, GRAPHICS_NORMAL);
  220. dmd.drawLine(27,8,28,8, GRAPHICS_NORMAL);
  221. dmd.drawLine(3,9,4,9, GRAPHICS_NORMAL);
  222. dmd.drawLine(26,9,27,9, GRAPHICS_NORMAL);
  223. dmd.drawLine(4,10,6,10, GRAPHICS_NORMAL);
  224. dmd.drawLine(24,10,26,10, GRAPHICS_NORMAL);
  225. dmd.drawLine(6,11,8,11, GRAPHICS_NORMAL);
  226. dmd.drawLine(22,11,24,11, GRAPHICS_NORMAL);
  227. dmd.drawLine(8,12,10,12, GRAPHICS_NORMAL);
  228. dmd.drawLine(20,12,22,12, GRAPHICS_NORMAL);
  229. dmd.drawLine(10,13,13,13, GRAPHICS_NORMAL);
  230. dmd.drawLine(17,13,20,13, GRAPHICS_NORMAL);
  231. dmd.drawLine(13,14,17,14, GRAPHICS_NORMAL);
  232. dmd.drawLine(14,3,16,3, GRAPHICS_NORMAL); //Circle
  233. dmd.drawLine(14,11,16,11, GRAPHICS_NORMAL);
  234. dmd.drawLine(11,6,11,8, GRAPHICS_NORMAL);
  235. dmd.drawLine(19,6,19,8, GRAPHICS_NORMAL);
  236. dmd.drawLine(12,5,13,4, GRAPHICS_NORMAL);
  237. dmd.drawLine(17,4,18,5, GRAPHICS_NORMAL);
  238. dmd.drawLine(18,9,17,10, GRAPHICS_NORMAL);
  239. dmd.drawLine(13,10,12,9, GRAPHICS_NORMAL);
  240. dmd.drawFilledBox(14,6,16,8, GRAPHICS_NORMAL); //Pupil
  241. dmd.writePixel(15,5, GRAPHICS_NORMAL, 1);
  242. dmd.writePixel(15,9, GRAPHICS_NORMAL, 1);
  243. }
  244.  
  245. void eyeStartupSequence()
  246. {
  247. wipe();
  248. wipe();
  249. wipeOn();
  250. wipeOff();
  251. wipeOn();
  252. delay(500);
  253. }
  254.  
  255. void wipe()
  256. {
  257. dmd.drawLine(0,0,0,15, GRAPHICS_NORMAL);
  258. delay(40);
  259. dmd.drawLine(0,0,0,15, GRAPHICS_NOR);
  260. dmd.drawFilledBox(0,0,1,15, GRAPHICS_NORMAL);
  261. delay(40);
  262. dmd.drawFilledBox(0,0,1,15, GRAPHICS_NOR);
  263. dmd.drawFilledBox (0,0,2,15, GRAPHICS_NORMAL);
  264. delay(40);
  265. dmd.drawFilledBox (0,0,2,15, GRAPHICS_NOR);
  266. dmd.drawFilledBox (1,0,3,15, GRAPHICS_NORMAL);
  267. delay(40);
  268. dmd.drawFilledBox (1,0,3,15, GRAPHICS_NOR);
  269. dmd.drawFilledBox (2,0,4,15, GRAPHICS_NORMAL);
  270. delay(40);
  271. dmd.drawFilledBox (2,0,4,15, GRAPHICS_NOR);
  272. dmd.drawFilledBox (3,0,5,15, GRAPHICS_NORMAL);
  273. delay(40);
  274. dmd.drawFilledBox (3,0,5,15, GRAPHICS_NOR);
  275. dmd.drawFilledBox (4,0,6,15, GRAPHICS_NORMAL);
  276. delay(40);
  277. dmd.drawFilledBox (4,0,6,15, GRAPHICS_NOR);
  278. dmd.drawFilledBox (5,0,7,15, GRAPHICS_NORMAL);
  279. delay(40);
  280. dmd.drawFilledBox (5,0,7,15, GRAPHICS_NOR);
  281. dmd.drawFilledBox (6,0,8,15, GRAPHICS_NORMAL);
  282. delay(40);
  283. dmd.drawFilledBox (6,0,8,15, GRAPHICS_NOR);
  284. dmd.drawFilledBox (7,0,9,15, GRAPHICS_NORMAL);
  285. delay(40);
  286. dmd.drawFilledBox (7,0,9,15, GRAPHICS_NOR);
  287. dmd.drawFilledBox (8,0,10,15, GRAPHICS_NORMAL);
  288. delay(40);
  289. dmd.drawFilledBox (8,0,10,15, GRAPHICS_NOR);
  290. dmd.drawFilledBox (9,0,11,15, GRAPHICS_NORMAL);
  291. delay(40);
  292. dmd.drawFilledBox (9,0,11,15, GRAPHICS_NOR);
  293. dmd.drawFilledBox (10,0,12,15, GRAPHICS_NORMAL);
  294. delay(40);
  295. dmd.drawFilledBox (10,0,12,15, GRAPHICS_NOR);
  296. dmd.drawFilledBox (11,0,13,15, GRAPHICS_NORMAL);
  297. delay(40);
  298. dmd.drawFilledBox (11,0,13,15, GRAPHICS_NOR);
  299. dmd.drawFilledBox (12,0,14,15, GRAPHICS_NORMAL);
  300. delay(40);
  301. dmd.drawFilledBox (12,0,14,15, GRAPHICS_NOR);
  302. dmd.drawFilledBox (13,0,15,15, GRAPHICS_NORMAL);
  303. delay(40);
  304. dmd.drawFilledBox (13,0,15,15, GRAPHICS_NOR);
  305. dmd.drawFilledBox (14,0,16,15, GRAPHICS_NORMAL);
  306. delay(40);
  307. dmd.drawFilledBox (14,0,16,15, GRAPHICS_NOR);
  308. dmd.drawFilledBox (15,0,17,15, GRAPHICS_NORMAL);
  309. delay(40);
  310. dmd.drawFilledBox (15,0,17,15, GRAPHICS_NOR);
  311. dmd.drawFilledBox (16,0,18,15, GRAPHICS_NORMAL);
  312. delay(40);
  313. dmd.drawFilledBox (16,0,18,15, GRAPHICS_NOR);
  314. dmd.drawFilledBox (17,0,19,15, GRAPHICS_NORMAL);
  315. delay(40);
  316. dmd.drawFilledBox (17,0,19,15, GRAPHICS_NOR);
  317. dmd.drawFilledBox (18,0,20,15, GRAPHICS_NORMAL);
  318. delay(40);
  319. dmd.drawFilledBox (18,0,20,15, GRAPHICS_NOR);
  320. dmd.drawFilledBox (19,0,21,15, GRAPHICS_NORMAL);
  321. delay(40);
  322. dmd.drawFilledBox (19,0,21,15, GRAPHICS_NOR);
  323. dmd.drawFilledBox (20,0,22,15, GRAPHICS_NORMAL);
  324. delay(40);
  325. dmd.drawFilledBox (20,0,22,15, GRAPHICS_NOR);
  326. dmd.drawFilledBox (21,0,23,15, GRAPHICS_NORMAL);
  327. delay(40);
  328. dmd.drawFilledBox (21,0,23,15, GRAPHICS_NOR);
  329. dmd.drawFilledBox (22,0,24,15, GRAPHICS_NORMAL);
  330. delay(40);
  331. dmd.drawFilledBox (22,0,24,15, GRAPHICS_NOR);
  332. dmd.drawFilledBox (23,0,25,15, GRAPHICS_NORMAL);
  333. delay(40);
  334. dmd.drawFilledBox (23,0,25,15, GRAPHICS_NOR);
  335. dmd.drawFilledBox (24,0,26,15, GRAPHICS_NORMAL);
  336. delay(40);
  337. dmd.drawFilledBox (24,0,26,15, GRAPHICS_NOR);
  338. dmd.drawFilledBox (25,0,27,15, GRAPHICS_NORMAL);
  339. delay(40);
  340. dmd.drawFilledBox (25,0,27,15, GRAPHICS_NOR);
  341. dmd.drawFilledBox (26,0,28,15, GRAPHICS_NORMAL);
  342. delay(40);
  343. dmd.drawFilledBox (26,0,28,15, GRAPHICS_NOR);
  344. dmd.drawFilledBox (27,0,29,15, GRAPHICS_NORMAL);
  345. delay(40);
  346. dmd.drawFilledBox (27,0,29,15, GRAPHICS_NOR);
  347. dmd.drawFilledBox (28,0,30,15, GRAPHICS_NORMAL);
  348. delay(40);
  349. dmd.drawFilledBox (28,0,30,15, GRAPHICS_NOR);
  350. dmd.drawFilledBox (29,0,31,15, GRAPHICS_NORMAL);
  351. delay(40);
  352. dmd.drawFilledBox (29,0,31,15, GRAPHICS_NOR);
  353. dmd.drawFilledBox (30,0,31,15, GRAPHICS_NORMAL);
  354. delay(40);
  355. dmd.drawFilledBox (30,0,31,15, GRAPHICS_NOR);
  356. dmd.drawLine(31,0,31,15, GRAPHICS_NORMAL);
  357. delay(40);
  358. dmd.drawLine(31,0,31,15, GRAPHICS_NOR);
  359.  
  360. }
  361.  
  362. void wipeOn()
  363. {
  364. dmd.drawLine(0,0,0,15, GRAPHICS_NORMAL);
  365. delay(40);
  366. dmd.drawLine(0,0,0,15, GRAPHICS_NOR);
  367. dmd.drawFilledBox(0,0,1,15, GRAPHICS_NORMAL);
  368. delay(40);
  369. dmd.drawFilledBox(0,0,1,15, GRAPHICS_NOR);
  370. dmd.drawFilledBox (0,0,2,15, GRAPHICS_NORMAL);
  371. delay(40);
  372. dmd.drawFilledBox (0,0,2,15, GRAPHICS_NOR);
  373. dmd.drawFilledBox (1,0,3,15, GRAPHICS_NORMAL);
  374. delay(40);
  375. dmd.drawFilledBox (1,0,3,15, GRAPHICS_NOR);
  376. dmd.drawFilledBox (2,0,4,15, GRAPHICS_NORMAL);
  377. delay(40);
  378. dmd.drawFilledBox (2,0,4,15, GRAPHICS_NOR);
  379. dmd.drawFilledBox (3,0,5,15, GRAPHICS_NORMAL);
  380. dmd.writePixel(2,7, GRAPHICS_NORMAL, 1); //ROW 2
  381. delay(40);
  382. dmd.drawFilledBox (3,0,5,15, GRAPHICS_NOR);
  383. dmd.drawFilledBox (4,0,6,15, GRAPHICS_NORMAL);
  384. dmd.writePixel(3,7, GRAPHICS_NORMAL, 1); //ROW 3
  385. delay(40);
  386. dmd.drawFilledBox (4,0,6,15, GRAPHICS_NOR);
  387. dmd.drawFilledBox (5,0,7,15, GRAPHICS_NORMAL);
  388. dmd.drawLine(4,6,4,8, GRAPHICS_NORMAL); //ROW 4
  389. delay(40);
  390. dmd.drawFilledBox (5,0,7,15, GRAPHICS_NOR);
  391. dmd.drawFilledBox (6,0,8,15, GRAPHICS_NORMAL);
  392. dmd.drawLine(5,6,5,8, GRAPHICS_NORMAL); //ROW 5
  393. delay(40);
  394. dmd.drawFilledBox (6,0,8,15, GRAPHICS_NOR);
  395. dmd.drawFilledBox (7,0,9,15, GRAPHICS_NORMAL);
  396. dmd.drawLine(6,6,6,8, GRAPHICS_NORMAL); //ROW 6
  397. delay(40);
  398. dmd.drawFilledBox (7,0,9,15, GRAPHICS_NOR);
  399. dmd.drawFilledBox (8,0,10,15, GRAPHICS_NORMAL);
  400. dmd.drawLine(7,6,7,8, GRAPHICS_NORMAL); //ROW 7
  401. delay(40);
  402. dmd.drawFilledBox (8,0,10,15, GRAPHICS_NOR);
  403. dmd.drawFilledBox (9,0,11,15, GRAPHICS_NORMAL);
  404. dmd.drawLine(8,6,8,8, GRAPHICS_NORMAL); //ROW 8
  405. delay(40);
  406. dmd.drawFilledBox (9,0,11,15, GRAPHICS_NOR);
  407. dmd.drawFilledBox (10,0,12,15, GRAPHICS_NORMAL);
  408. dmd.drawLine(9,6,9,8, GRAPHICS_NORMAL); //ROW 9
  409. delay(40);
  410. dmd.drawFilledBox (10,0,12,15, GRAPHICS_NOR);
  411. dmd.drawFilledBox (11,0,13,15, GRAPHICS_NORMAL);
  412. dmd.drawLine(10,6,10,8, GRAPHICS_NORMAL); //ROW 10
  413. delay(40);
  414. dmd.drawFilledBox (11,0,13,15, GRAPHICS_NOR);
  415. dmd.drawFilledBox (12,0,14,15, GRAPHICS_NORMAL);
  416. dmd.drawLine(11,6,11,8, GRAPHICS_NORMAL); //ROW 11
  417. delay(40);
  418. dmd.drawFilledBox (12,0,14,15, GRAPHICS_NOR);
  419. dmd.drawFilledBox (13,0,15,15, GRAPHICS_NORMAL);
  420. dmd.drawLine(12,6,12,8, GRAPHICS_NORMAL); //ROW 12
  421. delay(40);
  422. dmd.drawFilledBox (13,0,15,15, GRAPHICS_NOR);
  423. dmd.drawFilledBox (14,0,16,15, GRAPHICS_NORMAL);
  424. dmd.drawLine(13,5,13,9, GRAPHICS_NORMAL); //ROW 13
  425. delay(40);
  426. dmd.drawFilledBox (14,0,16,15, GRAPHICS_NOR);
  427. dmd.drawFilledBox (15,0,17,15, GRAPHICS_NORMAL);
  428. dmd.drawLine(14,5,14,9, GRAPHICS_NORMAL); //ROW 14
  429. delay(40);
  430. dmd.drawFilledBox (15,0,17,15, GRAPHICS_NOR);
  431. dmd.drawFilledBox (16,0,18,15, GRAPHICS_NORMAL);
  432. dmd.drawLine(15,5,15,9, GRAPHICS_NORMAL); //ROW 15
  433. delay(40);
  434. dmd.drawFilledBox (16,0,18,15, GRAPHICS_NOR);
  435. dmd.drawFilledBox (17,0,19,15, GRAPHICS_NORMAL);
  436. dmd.drawLine(16,5,16,9, GRAPHICS_NORMAL); //ROW 16
  437. delay(40);
  438. dmd.drawFilledBox (17,0,19,15, GRAPHICS_NOR);
  439. dmd.drawFilledBox (18,0,20,15, GRAPHICS_NORMAL);
  440. dmd.drawLine(17,5,17,9, GRAPHICS_NORMAL); //ROW 17
  441. delay(40);
  442. dmd.drawFilledBox (18,0,20,15, GRAPHICS_NOR);
  443. dmd.drawFilledBox (19,0,21,15, GRAPHICS_NORMAL);
  444. dmd.drawLine(18,6,18,8, GRAPHICS_NORMAL); //ROW 18
  445. delay(40);
  446. dmd.drawFilledBox (19,0,21,15, GRAPHICS_NOR);
  447. dmd.drawFilledBox (20,0,22,15, GRAPHICS_NORMAL);
  448. dmd.drawLine(19,6,19,8, GRAPHICS_NORMAL); //ROW 19
  449. delay(40);
  450. dmd.drawFilledBox (20,0,22,15, GRAPHICS_NOR);
  451. dmd.drawFilledBox (21,0,23,15, GRAPHICS_NORMAL);
  452. dmd.drawLine(20,6,20,8, GRAPHICS_NORMAL); //ROW 20
  453. delay(40);
  454. dmd.drawFilledBox (21,0,23,15, GRAPHICS_NOR);
  455. dmd.drawFilledBox (22,0,24,15, GRAPHICS_NORMAL);
  456. dmd.drawLine(21,6,21,8, GRAPHICS_NORMAL); //ROW 21
  457. delay(40);
  458. dmd.drawFilledBox (22,0,24,15, GRAPHICS_NOR);
  459. dmd.drawFilledBox (23,0,25,15, GRAPHICS_NORMAL);
  460. dmd.drawLine(22,6,22,8, GRAPHICS_NORMAL); //ROW 22
  461. delay(40);
  462. dmd.drawFilledBox (23,0,25,15, GRAPHICS_NOR);
  463. dmd.drawFilledBox (24,0,26,15, GRAPHICS_NORMAL);
  464. dmd.drawLine(23,6,23,8, GRAPHICS_NORMAL); //ROW 23
  465. delay(40);
  466. dmd.drawFilledBox (24,0,26,15, GRAPHICS_NOR);
  467. dmd.drawFilledBox (25,0,27,15, GRAPHICS_NORMAL);
  468. dmd.drawLine(24,6,24,8, GRAPHICS_NORMAL); //ROW 24
  469. delay(40);
  470. dmd.drawFilledBox (25,0,27,15, GRAPHICS_NOR);
  471. dmd.drawFilledBox (26,0,28,15, GRAPHICS_NORMAL);
  472. dmd.drawLine(25,6,25,8, GRAPHICS_NORMAL); //ROW 25
  473. delay(40);
  474. dmd.drawFilledBox (26,0,28,15, GRAPHICS_NOR);
  475. dmd.drawFilledBox (27,0,29,15, GRAPHICS_NORMAL);
  476. dmd.drawLine(26,6,26,8, GRAPHICS_NORMAL); //ROW 26
  477. delay(40);
  478. dmd.drawFilledBox (27,0,29,15, GRAPHICS_NOR);
  479. dmd.drawFilledBox (28,0,30,15, GRAPHICS_NORMAL);
  480. dmd.writePixel (27,7, GRAPHICS_NORMAL, 1); //ROW 27
  481. delay(40);
  482. dmd.drawFilledBox (28,0,30,15, GRAPHICS_NOR);
  483. dmd.drawFilledBox (29,0,31,15, GRAPHICS_NORMAL);
  484. dmd.writePixel (28,7, GRAPHICS_NORMAL, 1); //ROW 28
  485. delay(40);
  486. dmd.drawFilledBox (29,0,31,15, GRAPHICS_NOR);
  487. dmd.drawFilledBox (30,0,31,15, GRAPHICS_NORMAL);
  488. delay(40);
  489. dmd.drawFilledBox (30,0,31,15, GRAPHICS_NOR);
  490. dmd.drawLine(31,0,31,15, GRAPHICS_NORMAL);
  491. delay(40);
  492. dmd.drawLine(31,0,31,15, GRAPHICS_NOR);
  493. }
  494.  
  495. void wipeOff()
  496. {
  497. dmd.drawLine(0,0,0,15, GRAPHICS_NORMAL);
  498. delay(40);
  499. dmd.drawLine(0,0,0,15, GRAPHICS_NOR);
  500. dmd.drawFilledBox(0,0,1,15, GRAPHICS_NORMAL);
  501. delay(40);
  502. dmd.drawFilledBox(0,0,1,15, GRAPHICS_NOR);
  503. dmd.drawFilledBox (0,0,2,15, GRAPHICS_NORMAL);
  504. delay(40);
  505. dmd.drawFilledBox (0,0,2,15, GRAPHICS_NOR);
  506. dmd.drawFilledBox (1,0,3,15, GRAPHICS_NORMAL);
  507. delay(40);
  508. dmd.drawFilledBox (1,0,3,15, GRAPHICS_NOR);
  509. dmd.drawFilledBox (2,0,4,15, GRAPHICS_NORMAL);
  510. delay(40);
  511. dmd.drawFilledBox (2,0,4,15, GRAPHICS_NOR);
  512. dmd.drawFilledBox (3,0,5,15, GRAPHICS_NORMAL);
  513. dmd.writePixel(2,7, GRAPHICS_NOR, 1); //ROW 2
  514. delay(40);
  515. dmd.drawFilledBox (3,0,5,15, GRAPHICS_NOR);
  516. dmd.drawFilledBox (4,0,6,15, GRAPHICS_NORMAL);
  517. dmd.writePixel(3,7, GRAPHICS_NOR, 1); //ROW 3
  518. delay(40);
  519. dmd.drawFilledBox (4,0,6,15, GRAPHICS_NOR);
  520. dmd.drawFilledBox (5,0,7,15, GRAPHICS_NORMAL);
  521. dmd.drawLine(4,6,4,8, GRAPHICS_NOR); //ROW 4
  522. delay(40);
  523. dmd.drawFilledBox (5,0,7,15, GRAPHICS_NOR);
  524. dmd.drawFilledBox (6,0,8,15, GRAPHICS_NORMAL);
  525. dmd.drawLine(5,6,5,8, GRAPHICS_NOR); //ROW 5
  526. delay(40);
  527. dmd.drawFilledBox (6,0,8,15, GRAPHICS_NOR);
  528. dmd.drawFilledBox (7,0,9,15, GRAPHICS_NORMAL);
  529. dmd.drawLine(6,6,6,8, GRAPHICS_NOR); //ROW 6
  530. delay(40);
  531. dmd.drawFilledBox (7,0,9,15, GRAPHICS_NOR);
  532. dmd.drawFilledBox (8,0,10,15, GRAPHICS_NORMAL);
  533. dmd.drawLine(7,6,7,8, GRAPHICS_NOR); //ROW 7
  534. delay(40);
  535. dmd.drawFilledBox (8,0,10,15, GRAPHICS_NOR);
  536. dmd.drawFilledBox (9,0,11,15, GRAPHICS_NORMAL);
  537. dmd.drawLine(8,6,8,8, GRAPHICS_NOR); //ROW 8
  538. delay(40);
  539. dmd.drawFilledBox (9,0,11,15, GRAPHICS_NOR);
  540. dmd.drawFilledBox (10,0,12,15, GRAPHICS_NORMAL);
  541. dmd.drawLine(9,6,9,8, GRAPHICS_NOR); //ROW 9
  542. delay(40);
  543. dmd.drawFilledBox (10,0,12,15, GRAPHICS_NOR);
  544. dmd.drawFilledBox (11,0,13,15, GRAPHICS_NORMAL);
  545. dmd.drawLine(10,6,10,8, GRAPHICS_NOR); //ROW 10
  546. delay(40);
  547. dmd.drawFilledBox (11,0,13,15, GRAPHICS_NOR);
  548. dmd.drawFilledBox (12,0,14,15, GRAPHICS_NORMAL);
  549. dmd.drawLine(11,6,11,8, GRAPHICS_NOR); //ROW 11
  550. delay(40);
  551. dmd.drawFilledBox (12,0,14,15, GRAPHICS_NOR);
  552. dmd.drawFilledBox (13,0,15,15, GRAPHICS_NORMAL);
  553. dmd.drawLine(12,6,12,8, GRAPHICS_NOR); //ROW 12
  554. delay(40);
  555. dmd.drawFilledBox (13,0,15,15, GRAPHICS_NOR);
  556. dmd.drawFilledBox (14,0,16,15, GRAPHICS_NORMAL);
  557. dmd.drawLine(13,5,13,9, GRAPHICS_NOR); //ROW 13
  558. delay(40);
  559. dmd.drawFilledBox (14,0,16,15, GRAPHICS_NOR);
  560. dmd.drawFilledBox (15,0,17,15, GRAPHICS_NORMAL);
  561. dmd.drawLine(14,5,14,9, GRAPHICS_NOR); //ROW 14
  562. delay(40);
  563. dmd.drawFilledBox (15,0,17,15, GRAPHICS_NOR);
  564. dmd.drawFilledBox (16,0,18,15, GRAPHICS_NORMAL);
  565. dmd.drawLine(15,5,15,9, GRAPHICS_NOR); //ROW 15
  566. delay(40);
  567. dmd.drawFilledBox (16,0,18,15, GRAPHICS_NOR);
  568. dmd.drawFilledBox (17,0,19,15, GRAPHICS_NORMAL);
  569. dmd.drawLine(16,5,16,9, GRAPHICS_NOR); //ROW 16
  570. delay(40);
  571. dmd.drawFilledBox (17,0,19,15, GRAPHICS_NOR);
  572. dmd.drawFilledBox (18,0,20,15, GRAPHICS_NORMAL);
  573. dmd.drawLine(17,5,17,9, GRAPHICS_NOR); //ROW 17
  574. delay(40);
  575. dmd.drawFilledBox (18,0,20,15, GRAPHICS_NOR);
  576. dmd.drawFilledBox (19,0,21,15, GRAPHICS_NORMAL);
  577. dmd.drawLine(18,6,18,8, GRAPHICS_NOR); //ROW 18
  578. delay(40);
  579. dmd.drawFilledBox (19,0,21,15, GRAPHICS_NOR);
  580. dmd.drawFilledBox (20,0,22,15, GRAPHICS_NORMAL);
  581. dmd.drawLine(19,6,19,8, GRAPHICS_NOR); //ROW 19
  582. delay(40);
  583. dmd.drawFilledBox (20,0,22,15, GRAPHICS_NOR);
  584. dmd.drawFilledBox (21,0,23,15, GRAPHICS_NORMAL);
  585. dmd.drawLine(20,6,20,8, GRAPHICS_NOR); //ROW 20
  586. delay(40);
  587. dmd.drawFilledBox (21,0,23,15, GRAPHICS_NOR);
  588. dmd.drawFilledBox (22,0,24,15, GRAPHICS_NORMAL);
  589. dmd.drawLine(21,6,21,8, GRAPHICS_NOR); //ROW 21
  590. delay(40);
  591. dmd.drawFilledBox (22,0,24,15, GRAPHICS_NOR);
  592. dmd.drawFilledBox (23,0,25,15, GRAPHICS_NORMAL);
  593. dmd.drawLine(22,6,22,8, GRAPHICS_NOR); //ROW 22
  594. delay(40);
  595. dmd.drawFilledBox (23,0,25,15, GRAPHICS_NOR);
  596. dmd.drawFilledBox (24,0,26,15, GRAPHICS_NORMAL);
  597. dmd.drawLine(23,6,23,8, GRAPHICS_NOR); //ROW 23
  598. delay(40);
  599. dmd.drawFilledBox (24,0,26,15, GRAPHICS_NOR);
  600. dmd.drawFilledBox (25,0,27,15, GRAPHICS_NORMAL);
  601. dmd.drawLine(24,6,24,8, GRAPHICS_NOR); //ROW 24
  602. delay(40);
  603. dmd.drawFilledBox (25,0,27,15, GRAPHICS_NOR);
  604. dmd.drawFilledBox (26,0,28,15, GRAPHICS_NORMAL);
  605. dmd.drawLine(25,6,25,8, GRAPHICS_NOR); //ROW 25
  606. delay(40);
  607. dmd.drawFilledBox (26,0,28,15, GRAPHICS_NOR);
  608. dmd.drawFilledBox (27,0,29,15, GRAPHICS_NORMAL);
  609. dmd.drawLine(26,6,26,8, GRAPHICS_NOR); //ROW 26
  610. delay(40);
  611. dmd.drawFilledBox (27,0,29,15, GRAPHICS_NOR);
  612. dmd.drawFilledBox (28,0,30,15, GRAPHICS_NORMAL);
  613. dmd.writePixel (27,7, GRAPHICS_NOR, 1); //ROW 27
  614. delay(40);
  615. dmd.drawFilledBox (28,0,30,15, GRAPHICS_NOR);
  616. dmd.drawFilledBox (29,0,31,15, GRAPHICS_NORMAL);
  617. dmd.writePixel (28,7, GRAPHICS_NOR, 1); //ROW 28
  618. delay(40);
  619. dmd.drawFilledBox (29,0,31,15, GRAPHICS_NOR);
  620. dmd.drawFilledBox (30,0,31,15, GRAPHICS_NORMAL);
  621. delay(40);
  622. dmd.drawFilledBox (30,0,31,15, GRAPHICS_NOR);
  623. dmd.drawLine(31,0,31,15, GRAPHICS_NORMAL);
  624. delay(40);
  625. dmd.drawLine(31,0,31,15, GRAPHICS_NOR);
  626. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement