Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const int sensorPin = 4;
- int sensorState;
- int lastSensorState = LOW;
- long lastDebounceTime = 0;
- long debounceDelay = 50;
- #include "SPI.h"
- #include "DMD.h"
- #include "TimerOne.h"
- #define DISPLAYS_ACROSS 1
- #define DISPLAYS_DOWN 1
- DMD dmd(DISPLAYS_ACROSS,DISPLAYS_DOWN);
- void ScanDMD()
- {
- dmd.scanDisplayBySPI();
- }
- void setup()
- {
- pinMode(sensorPin, INPUT);
- digitalWrite(sensorPin, HIGH);
- Timer1.initialize( 5000 );
- Timer1.attachInterrupt( ScanDMD );
- dmd.clearScreen( true );
- }
- void loop()
- {
- int reading = digitalRead(sensorPin);
- if (reading != lastSensorState)
- {
- lastDebounceTime = millis();
- }
- if ((millis() - lastDebounceTime) > debounceDelay)
- {
- if (reading != sensorState)
- {
- sensorState = reading;
- {
- eyeSetup();
- }
- }
- }
- lastSensorState = reading;
- }
- void eyeSetup()
- {
- if (sensorState == HIGH)
- {
- eyeBlink();
- }
- else
- {
- eyeStare();
- }
- }
- void eyeBlink()
- {
- static int count = 0;
- if (count > 0)
- {
- dmd.clearScreen(true); //Nearly Open
- dmd.drawLine(12,2,18,2, GRAPHICS_NORMAL); //Outline
- dmd.drawLine(8,3,12,3, GRAPHICS_NORMAL);
- dmd.drawLine(18,3,22,3, GRAPHICS_NORMAL);
- dmd.drawLine(5,4,8,4, GRAPHICS_NORMAL);
- dmd.drawLine(22,4,25,4, GRAPHICS_NORMAL);
- dmd.drawLine(3,5,5,5, GRAPHICS_NORMAL);
- dmd.drawLine(25,5,27,5, GRAPHICS_NORMAL);
- dmd.drawLine(2,6,3,6, GRAPHICS_NORMAL);
- dmd.drawLine(27,6,28,6, GRAPHICS_NORMAL);
- dmd.writePixel(2,7, GRAPHICS_NORMAL, 1);
- dmd.writePixel(28,7, GRAPHICS_NORMAL, 1);
- dmd.drawLine(2,8,3,8, GRAPHICS_NORMAL);
- dmd.drawLine(27,8,28,8, GRAPHICS_NORMAL);
- dmd.drawLine(3,9,5,9, GRAPHICS_NORMAL);
- dmd.drawLine(25,9,27,9, GRAPHICS_NORMAL);
- dmd.drawLine(6,10,8,10, GRAPHICS_NORMAL);
- dmd.drawLine(22,10,25,10, GRAPHICS_NORMAL);
- dmd.drawLine(8,11,12,11, GRAPHICS_NORMAL);
- dmd.drawLine(18,11,22,11, GRAPHICS_NORMAL);
- dmd.drawLine(12,12,18,12, GRAPHICS_NORMAL);
- dmd.drawLine(14,3,16,3, GRAPHICS_NORMAL); //Circle
- dmd.drawLine(14,11,16,11, GRAPHICS_NORMAL);
- dmd.drawLine(11,6,11,8, GRAPHICS_NORMAL);
- dmd.drawLine(19,6,19,8, GRAPHICS_NORMAL);
- dmd.drawLine(12,5,13,4, GRAPHICS_NORMAL);
- dmd.drawLine(17,4,18,5, GRAPHICS_NORMAL);
- dmd.drawLine(18,9,17,10, GRAPHICS_NORMAL);
- dmd.drawLine(13,10,12,9, GRAPHICS_NORMAL);
- dmd.drawFilledBox(14,6,16,8, GRAPHICS_NORMAL); //Pupil
- dmd.writePixel(15,5, GRAPHICS_NORMAL, 1);
- dmd.writePixel(15,9, GRAPHICS_NORMAL, 1);
- delay(40);
- dmd.clearScreen(true); //Nearly Shut
- dmd.drawLine(7,4,23,4, GRAPHICS_NORMAL); //Outline
- dmd.drawLine(4,5,7,5, GRAPHICS_NORMAL);
- dmd.drawLine(23,5,26,5, GRAPHICS_NORMAL);
- dmd.drawLine(2,6,4,6, GRAPHICS_NORMAL);
- dmd.drawLine(26,6,28,6, GRAPHICS_NORMAL);
- dmd.writePixel(2,7, GRAPHICS_NORMAL, 1);
- dmd.writePixel(28,7, GRAPHICS_NORMAL, 1);
- dmd.drawLine(2,8,4,8, GRAPHICS_NORMAL);
- dmd.drawLine(26,8,28,8, GRAPHICS_NORMAL);
- dmd.drawLine(4,9,7,9, GRAPHICS_NORMAL);
- dmd.drawLine(23,9,26,9, GRAPHICS_NORMAL);
- dmd.drawLine(7,10,23,10, GRAPHICS_NORMAL);
- dmd.drawLine(11,6,11,8, GRAPHICS_NORMAL); //Circle
- dmd.drawLine(19,6,19,8, GRAPHICS_NORMAL);
- dmd.drawLine(12,5,13,4, GRAPHICS_NORMAL);
- dmd.drawLine(17,4,18,5, GRAPHICS_NORMAL);
- dmd.drawLine(18,9,17,10, GRAPHICS_NORMAL);
- dmd.drawLine(13,10,12,9, GRAPHICS_NORMAL);
- dmd.drawFilledBox(14,6,16,8, GRAPHICS_NORMAL); //Pupil
- dmd.writePixel(15,5, GRAPHICS_NORMAL, 1);
- dmd.writePixel(15,9, GRAPHICS_NORMAL, 1);
- delay(40);
- dmd.clearScreen(true); //Shut
- dmd.drawFilledBox(4,6,26,8, GRAPHICS_NORMAL); //Outline
- dmd.drawBox(13,5,17,9, GRAPHICS_NORMAL);
- dmd.drawLine(2,7,28,7, GRAPHICS_NORMAL);
- }
- else
- {
- eyeStartupSequence();
- }
- count ++;
- }
- void eyeStare()
- {
- dmd.clearScreen(true); //Nearly Shut
- dmd.drawLine(7,4,23,4, GRAPHICS_NORMAL); //Outline
- dmd.drawLine(4,5,7,5, GRAPHICS_NORMAL);
- dmd.drawLine(23,5,26,5, GRAPHICS_NORMAL);
- dmd.drawLine(2,6,4,6, GRAPHICS_NORMAL);
- dmd.drawLine(26,6,28,6, GRAPHICS_NORMAL);
- dmd.writePixel(2,7, GRAPHICS_NORMAL, 1);
- dmd.writePixel(28,7, GRAPHICS_NORMAL, 1);
- dmd.drawLine(2,8,4,8, GRAPHICS_NORMAL);
- dmd.drawLine(26,8,28,8, GRAPHICS_NORMAL);
- dmd.drawLine(4,9,7,9, GRAPHICS_NORMAL);
- dmd.drawLine(23,9,26,9, GRAPHICS_NORMAL);
- dmd.drawLine(7,10,23,10, GRAPHICS_NORMAL);
- dmd.drawLine(11,6,11,8, GRAPHICS_NORMAL); //Circle
- dmd.drawLine(19,6,19,8, GRAPHICS_NORMAL);
- dmd.drawLine(12,5,13,4, GRAPHICS_NORMAL);
- dmd.drawLine(17,4,18,5, GRAPHICS_NORMAL);
- dmd.drawLine(18,9,17,10, GRAPHICS_NORMAL);
- dmd.drawLine(13,10,12,9, GRAPHICS_NORMAL);
- dmd.drawFilledBox(14,6,16,8, GRAPHICS_NORMAL); //Pupil
- dmd.writePixel(15,5, GRAPHICS_NORMAL, 1);
- dmd.writePixel(15,9, GRAPHICS_NORMAL, 1);
- delay(40);
- dmd.clearScreen(true); //Nearly Open
- dmd.drawLine(12,2,18,2, GRAPHICS_NORMAL); //Outline
- dmd.drawLine(8,3,12,3, GRAPHICS_NORMAL);
- dmd.drawLine(18,3,22,3, GRAPHICS_NORMAL);
- dmd.drawLine(5,4,8,4, GRAPHICS_NORMAL);
- dmd.drawLine(22,4,25,4, GRAPHICS_NORMAL);
- dmd.drawLine(3,5,5,5, GRAPHICS_NORMAL);
- dmd.drawLine(25,5,27,5, GRAPHICS_NORMAL);
- dmd.drawLine(2,6,3,6, GRAPHICS_NORMAL);
- dmd.drawLine(27,6,28,6, GRAPHICS_NORMAL);
- dmd.writePixel(2,7, GRAPHICS_NORMAL, 1);
- dmd.writePixel(28,7, GRAPHICS_NORMAL, 1);
- dmd.drawLine(2,8,3,8, GRAPHICS_NORMAL);
- dmd.drawLine(27,8,28,8, GRAPHICS_NORMAL);
- dmd.drawLine(3,9,5,9, GRAPHICS_NORMAL);
- dmd.drawLine(25,9,27,9, GRAPHICS_NORMAL);
- dmd.drawLine(6,10,8,10, GRAPHICS_NORMAL);
- dmd.drawLine(22,10,25,10, GRAPHICS_NORMAL);
- dmd.drawLine(8,11,12,11, GRAPHICS_NORMAL);
- dmd.drawLine(18,11,22,11, GRAPHICS_NORMAL);
- dmd.drawLine(12,12,18,12, GRAPHICS_NORMAL);
- dmd.drawLine(14,3,16,3, GRAPHICS_NORMAL); //Circle
- dmd.drawLine(14,11,16,11, GRAPHICS_NORMAL);
- dmd.drawLine(11,6,11,8, GRAPHICS_NORMAL);
- dmd.drawLine(19,6,19,8, GRAPHICS_NORMAL);
- dmd.drawLine(12,5,13,4, GRAPHICS_NORMAL);
- dmd.drawLine(17,4,18,5, GRAPHICS_NORMAL);
- dmd.drawLine(18,9,17,10, GRAPHICS_NORMAL);
- dmd.drawLine(13,10,12,9, GRAPHICS_NORMAL);
- dmd.drawFilledBox(14,6,16,8, GRAPHICS_NORMAL); //Pupil
- dmd.writePixel(15,5, GRAPHICS_NORMAL, 1);
- dmd.writePixel(15,9, GRAPHICS_NORMAL, 1);
- delay(40);
- dmd.clearScreen(true); //Open
- dmd.drawLine(13,0,17,0, GRAPHICS_NORMAL); //Outline
- dmd.drawLine(10,1,13,1, GRAPHICS_NORMAL);
- dmd.drawLine(17,1,20,1, GRAPHICS_NORMAL);
- dmd.drawLine(8,2,10,2, GRAPHICS_NORMAL);
- dmd.drawLine(20,2,22,2, GRAPHICS_NORMAL);
- dmd.drawLine(6,3,8,3, GRAPHICS_NORMAL);
- dmd.drawLine(22,3,24,3, GRAPHICS_NORMAL);
- dmd.drawLine(4,4,6,4, GRAPHICS_NORMAL);
- dmd.drawLine(24,4,26,4, GRAPHICS_NORMAL);
- dmd.drawLine(3,5,4,5, GRAPHICS_NORMAL);
- dmd.drawLine(26,5,27,5, GRAPHICS_NORMAL);
- dmd.drawLine(2,6,3,6, GRAPHICS_NORMAL);
- dmd.drawLine(27,6,28,6, GRAPHICS_NORMAL);
- dmd.writePixel(2,7, GRAPHICS_NORMAL, 1);
- dmd.writePixel(28,7, GRAPHICS_NORMAL, 1);
- dmd.drawLine(2,8,3,8, GRAPHICS_NORMAL);
- dmd.drawLine(27,8,28,8, GRAPHICS_NORMAL);
- dmd.drawLine(3,9,4,9, GRAPHICS_NORMAL);
- dmd.drawLine(26,9,27,9, GRAPHICS_NORMAL);
- dmd.drawLine(4,10,6,10, GRAPHICS_NORMAL);
- dmd.drawLine(24,10,26,10, GRAPHICS_NORMAL);
- dmd.drawLine(6,11,8,11, GRAPHICS_NORMAL);
- dmd.drawLine(22,11,24,11, GRAPHICS_NORMAL);
- dmd.drawLine(8,12,10,12, GRAPHICS_NORMAL);
- dmd.drawLine(20,12,22,12, GRAPHICS_NORMAL);
- dmd.drawLine(10,13,13,13, GRAPHICS_NORMAL);
- dmd.drawLine(17,13,20,13, GRAPHICS_NORMAL);
- dmd.drawLine(13,14,17,14, GRAPHICS_NORMAL);
- dmd.drawLine(14,3,16,3, GRAPHICS_NORMAL); //Circle
- dmd.drawLine(14,11,16,11, GRAPHICS_NORMAL);
- dmd.drawLine(11,6,11,8, GRAPHICS_NORMAL);
- dmd.drawLine(19,6,19,8, GRAPHICS_NORMAL);
- dmd.drawLine(12,5,13,4, GRAPHICS_NORMAL);
- dmd.drawLine(17,4,18,5, GRAPHICS_NORMAL);
- dmd.drawLine(18,9,17,10, GRAPHICS_NORMAL);
- dmd.drawLine(13,10,12,9, GRAPHICS_NORMAL);
- dmd.drawFilledBox(14,6,16,8, GRAPHICS_NORMAL); //Pupil
- dmd.writePixel(15,5, GRAPHICS_NORMAL, 1);
- dmd.writePixel(15,9, GRAPHICS_NORMAL, 1);
- }
- void eyeStartupSequence()
- {
- wipe();
- wipe();
- wipeOn();
- wipeOff();
- wipeOn();
- delay(500);
- }
- void wipe()
- {
- dmd.drawLine(0,0,0,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawLine(0,0,0,15, GRAPHICS_NOR);
- dmd.drawFilledBox(0,0,1,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox(0,0,1,15, GRAPHICS_NOR);
- dmd.drawFilledBox (0,0,2,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (0,0,2,15, GRAPHICS_NOR);
- dmd.drawFilledBox (1,0,3,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (1,0,3,15, GRAPHICS_NOR);
- dmd.drawFilledBox (2,0,4,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (2,0,4,15, GRAPHICS_NOR);
- dmd.drawFilledBox (3,0,5,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (3,0,5,15, GRAPHICS_NOR);
- dmd.drawFilledBox (4,0,6,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (4,0,6,15, GRAPHICS_NOR);
- dmd.drawFilledBox (5,0,7,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (5,0,7,15, GRAPHICS_NOR);
- dmd.drawFilledBox (6,0,8,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (6,0,8,15, GRAPHICS_NOR);
- dmd.drawFilledBox (7,0,9,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (7,0,9,15, GRAPHICS_NOR);
- dmd.drawFilledBox (8,0,10,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (8,0,10,15, GRAPHICS_NOR);
- dmd.drawFilledBox (9,0,11,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (9,0,11,15, GRAPHICS_NOR);
- dmd.drawFilledBox (10,0,12,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (10,0,12,15, GRAPHICS_NOR);
- dmd.drawFilledBox (11,0,13,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (11,0,13,15, GRAPHICS_NOR);
- dmd.drawFilledBox (12,0,14,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (12,0,14,15, GRAPHICS_NOR);
- dmd.drawFilledBox (13,0,15,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (13,0,15,15, GRAPHICS_NOR);
- dmd.drawFilledBox (14,0,16,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (14,0,16,15, GRAPHICS_NOR);
- dmd.drawFilledBox (15,0,17,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (15,0,17,15, GRAPHICS_NOR);
- dmd.drawFilledBox (16,0,18,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (16,0,18,15, GRAPHICS_NOR);
- dmd.drawFilledBox (17,0,19,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (17,0,19,15, GRAPHICS_NOR);
- dmd.drawFilledBox (18,0,20,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (18,0,20,15, GRAPHICS_NOR);
- dmd.drawFilledBox (19,0,21,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (19,0,21,15, GRAPHICS_NOR);
- dmd.drawFilledBox (20,0,22,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (20,0,22,15, GRAPHICS_NOR);
- dmd.drawFilledBox (21,0,23,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (21,0,23,15, GRAPHICS_NOR);
- dmd.drawFilledBox (22,0,24,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (22,0,24,15, GRAPHICS_NOR);
- dmd.drawFilledBox (23,0,25,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (23,0,25,15, GRAPHICS_NOR);
- dmd.drawFilledBox (24,0,26,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (24,0,26,15, GRAPHICS_NOR);
- dmd.drawFilledBox (25,0,27,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (25,0,27,15, GRAPHICS_NOR);
- dmd.drawFilledBox (26,0,28,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (26,0,28,15, GRAPHICS_NOR);
- dmd.drawFilledBox (27,0,29,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (27,0,29,15, GRAPHICS_NOR);
- dmd.drawFilledBox (28,0,30,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (28,0,30,15, GRAPHICS_NOR);
- dmd.drawFilledBox (29,0,31,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (29,0,31,15, GRAPHICS_NOR);
- dmd.drawFilledBox (30,0,31,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (30,0,31,15, GRAPHICS_NOR);
- dmd.drawLine(31,0,31,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawLine(31,0,31,15, GRAPHICS_NOR);
- }
- void wipeOn()
- {
- dmd.drawLine(0,0,0,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawLine(0,0,0,15, GRAPHICS_NOR);
- dmd.drawFilledBox(0,0,1,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox(0,0,1,15, GRAPHICS_NOR);
- dmd.drawFilledBox (0,0,2,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (0,0,2,15, GRAPHICS_NOR);
- dmd.drawFilledBox (1,0,3,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (1,0,3,15, GRAPHICS_NOR);
- dmd.drawFilledBox (2,0,4,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (2,0,4,15, GRAPHICS_NOR);
- dmd.drawFilledBox (3,0,5,15, GRAPHICS_NORMAL);
- dmd.writePixel(2,7, GRAPHICS_NORMAL, 1); //ROW 2
- delay(40);
- dmd.drawFilledBox (3,0,5,15, GRAPHICS_NOR);
- dmd.drawFilledBox (4,0,6,15, GRAPHICS_NORMAL);
- dmd.writePixel(3,7, GRAPHICS_NORMAL, 1); //ROW 3
- delay(40);
- dmd.drawFilledBox (4,0,6,15, GRAPHICS_NOR);
- dmd.drawFilledBox (5,0,7,15, GRAPHICS_NORMAL);
- dmd.drawLine(4,6,4,8, GRAPHICS_NORMAL); //ROW 4
- delay(40);
- dmd.drawFilledBox (5,0,7,15, GRAPHICS_NOR);
- dmd.drawFilledBox (6,0,8,15, GRAPHICS_NORMAL);
- dmd.drawLine(5,6,5,8, GRAPHICS_NORMAL); //ROW 5
- delay(40);
- dmd.drawFilledBox (6,0,8,15, GRAPHICS_NOR);
- dmd.drawFilledBox (7,0,9,15, GRAPHICS_NORMAL);
- dmd.drawLine(6,6,6,8, GRAPHICS_NORMAL); //ROW 6
- delay(40);
- dmd.drawFilledBox (7,0,9,15, GRAPHICS_NOR);
- dmd.drawFilledBox (8,0,10,15, GRAPHICS_NORMAL);
- dmd.drawLine(7,6,7,8, GRAPHICS_NORMAL); //ROW 7
- delay(40);
- dmd.drawFilledBox (8,0,10,15, GRAPHICS_NOR);
- dmd.drawFilledBox (9,0,11,15, GRAPHICS_NORMAL);
- dmd.drawLine(8,6,8,8, GRAPHICS_NORMAL); //ROW 8
- delay(40);
- dmd.drawFilledBox (9,0,11,15, GRAPHICS_NOR);
- dmd.drawFilledBox (10,0,12,15, GRAPHICS_NORMAL);
- dmd.drawLine(9,6,9,8, GRAPHICS_NORMAL); //ROW 9
- delay(40);
- dmd.drawFilledBox (10,0,12,15, GRAPHICS_NOR);
- dmd.drawFilledBox (11,0,13,15, GRAPHICS_NORMAL);
- dmd.drawLine(10,6,10,8, GRAPHICS_NORMAL); //ROW 10
- delay(40);
- dmd.drawFilledBox (11,0,13,15, GRAPHICS_NOR);
- dmd.drawFilledBox (12,0,14,15, GRAPHICS_NORMAL);
- dmd.drawLine(11,6,11,8, GRAPHICS_NORMAL); //ROW 11
- delay(40);
- dmd.drawFilledBox (12,0,14,15, GRAPHICS_NOR);
- dmd.drawFilledBox (13,0,15,15, GRAPHICS_NORMAL);
- dmd.drawLine(12,6,12,8, GRAPHICS_NORMAL); //ROW 12
- delay(40);
- dmd.drawFilledBox (13,0,15,15, GRAPHICS_NOR);
- dmd.drawFilledBox (14,0,16,15, GRAPHICS_NORMAL);
- dmd.drawLine(13,5,13,9, GRAPHICS_NORMAL); //ROW 13
- delay(40);
- dmd.drawFilledBox (14,0,16,15, GRAPHICS_NOR);
- dmd.drawFilledBox (15,0,17,15, GRAPHICS_NORMAL);
- dmd.drawLine(14,5,14,9, GRAPHICS_NORMAL); //ROW 14
- delay(40);
- dmd.drawFilledBox (15,0,17,15, GRAPHICS_NOR);
- dmd.drawFilledBox (16,0,18,15, GRAPHICS_NORMAL);
- dmd.drawLine(15,5,15,9, GRAPHICS_NORMAL); //ROW 15
- delay(40);
- dmd.drawFilledBox (16,0,18,15, GRAPHICS_NOR);
- dmd.drawFilledBox (17,0,19,15, GRAPHICS_NORMAL);
- dmd.drawLine(16,5,16,9, GRAPHICS_NORMAL); //ROW 16
- delay(40);
- dmd.drawFilledBox (17,0,19,15, GRAPHICS_NOR);
- dmd.drawFilledBox (18,0,20,15, GRAPHICS_NORMAL);
- dmd.drawLine(17,5,17,9, GRAPHICS_NORMAL); //ROW 17
- delay(40);
- dmd.drawFilledBox (18,0,20,15, GRAPHICS_NOR);
- dmd.drawFilledBox (19,0,21,15, GRAPHICS_NORMAL);
- dmd.drawLine(18,6,18,8, GRAPHICS_NORMAL); //ROW 18
- delay(40);
- dmd.drawFilledBox (19,0,21,15, GRAPHICS_NOR);
- dmd.drawFilledBox (20,0,22,15, GRAPHICS_NORMAL);
- dmd.drawLine(19,6,19,8, GRAPHICS_NORMAL); //ROW 19
- delay(40);
- dmd.drawFilledBox (20,0,22,15, GRAPHICS_NOR);
- dmd.drawFilledBox (21,0,23,15, GRAPHICS_NORMAL);
- dmd.drawLine(20,6,20,8, GRAPHICS_NORMAL); //ROW 20
- delay(40);
- dmd.drawFilledBox (21,0,23,15, GRAPHICS_NOR);
- dmd.drawFilledBox (22,0,24,15, GRAPHICS_NORMAL);
- dmd.drawLine(21,6,21,8, GRAPHICS_NORMAL); //ROW 21
- delay(40);
- dmd.drawFilledBox (22,0,24,15, GRAPHICS_NOR);
- dmd.drawFilledBox (23,0,25,15, GRAPHICS_NORMAL);
- dmd.drawLine(22,6,22,8, GRAPHICS_NORMAL); //ROW 22
- delay(40);
- dmd.drawFilledBox (23,0,25,15, GRAPHICS_NOR);
- dmd.drawFilledBox (24,0,26,15, GRAPHICS_NORMAL);
- dmd.drawLine(23,6,23,8, GRAPHICS_NORMAL); //ROW 23
- delay(40);
- dmd.drawFilledBox (24,0,26,15, GRAPHICS_NOR);
- dmd.drawFilledBox (25,0,27,15, GRAPHICS_NORMAL);
- dmd.drawLine(24,6,24,8, GRAPHICS_NORMAL); //ROW 24
- delay(40);
- dmd.drawFilledBox (25,0,27,15, GRAPHICS_NOR);
- dmd.drawFilledBox (26,0,28,15, GRAPHICS_NORMAL);
- dmd.drawLine(25,6,25,8, GRAPHICS_NORMAL); //ROW 25
- delay(40);
- dmd.drawFilledBox (26,0,28,15, GRAPHICS_NOR);
- dmd.drawFilledBox (27,0,29,15, GRAPHICS_NORMAL);
- dmd.drawLine(26,6,26,8, GRAPHICS_NORMAL); //ROW 26
- delay(40);
- dmd.drawFilledBox (27,0,29,15, GRAPHICS_NOR);
- dmd.drawFilledBox (28,0,30,15, GRAPHICS_NORMAL);
- dmd.writePixel (27,7, GRAPHICS_NORMAL, 1); //ROW 27
- delay(40);
- dmd.drawFilledBox (28,0,30,15, GRAPHICS_NOR);
- dmd.drawFilledBox (29,0,31,15, GRAPHICS_NORMAL);
- dmd.writePixel (28,7, GRAPHICS_NORMAL, 1); //ROW 28
- delay(40);
- dmd.drawFilledBox (29,0,31,15, GRAPHICS_NOR);
- dmd.drawFilledBox (30,0,31,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (30,0,31,15, GRAPHICS_NOR);
- dmd.drawLine(31,0,31,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawLine(31,0,31,15, GRAPHICS_NOR);
- }
- void wipeOff()
- {
- dmd.drawLine(0,0,0,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawLine(0,0,0,15, GRAPHICS_NOR);
- dmd.drawFilledBox(0,0,1,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox(0,0,1,15, GRAPHICS_NOR);
- dmd.drawFilledBox (0,0,2,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (0,0,2,15, GRAPHICS_NOR);
- dmd.drawFilledBox (1,0,3,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (1,0,3,15, GRAPHICS_NOR);
- dmd.drawFilledBox (2,0,4,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (2,0,4,15, GRAPHICS_NOR);
- dmd.drawFilledBox (3,0,5,15, GRAPHICS_NORMAL);
- dmd.writePixel(2,7, GRAPHICS_NOR, 1); //ROW 2
- delay(40);
- dmd.drawFilledBox (3,0,5,15, GRAPHICS_NOR);
- dmd.drawFilledBox (4,0,6,15, GRAPHICS_NORMAL);
- dmd.writePixel(3,7, GRAPHICS_NOR, 1); //ROW 3
- delay(40);
- dmd.drawFilledBox (4,0,6,15, GRAPHICS_NOR);
- dmd.drawFilledBox (5,0,7,15, GRAPHICS_NORMAL);
- dmd.drawLine(4,6,4,8, GRAPHICS_NOR); //ROW 4
- delay(40);
- dmd.drawFilledBox (5,0,7,15, GRAPHICS_NOR);
- dmd.drawFilledBox (6,0,8,15, GRAPHICS_NORMAL);
- dmd.drawLine(5,6,5,8, GRAPHICS_NOR); //ROW 5
- delay(40);
- dmd.drawFilledBox (6,0,8,15, GRAPHICS_NOR);
- dmd.drawFilledBox (7,0,9,15, GRAPHICS_NORMAL);
- dmd.drawLine(6,6,6,8, GRAPHICS_NOR); //ROW 6
- delay(40);
- dmd.drawFilledBox (7,0,9,15, GRAPHICS_NOR);
- dmd.drawFilledBox (8,0,10,15, GRAPHICS_NORMAL);
- dmd.drawLine(7,6,7,8, GRAPHICS_NOR); //ROW 7
- delay(40);
- dmd.drawFilledBox (8,0,10,15, GRAPHICS_NOR);
- dmd.drawFilledBox (9,0,11,15, GRAPHICS_NORMAL);
- dmd.drawLine(8,6,8,8, GRAPHICS_NOR); //ROW 8
- delay(40);
- dmd.drawFilledBox (9,0,11,15, GRAPHICS_NOR);
- dmd.drawFilledBox (10,0,12,15, GRAPHICS_NORMAL);
- dmd.drawLine(9,6,9,8, GRAPHICS_NOR); //ROW 9
- delay(40);
- dmd.drawFilledBox (10,0,12,15, GRAPHICS_NOR);
- dmd.drawFilledBox (11,0,13,15, GRAPHICS_NORMAL);
- dmd.drawLine(10,6,10,8, GRAPHICS_NOR); //ROW 10
- delay(40);
- dmd.drawFilledBox (11,0,13,15, GRAPHICS_NOR);
- dmd.drawFilledBox (12,0,14,15, GRAPHICS_NORMAL);
- dmd.drawLine(11,6,11,8, GRAPHICS_NOR); //ROW 11
- delay(40);
- dmd.drawFilledBox (12,0,14,15, GRAPHICS_NOR);
- dmd.drawFilledBox (13,0,15,15, GRAPHICS_NORMAL);
- dmd.drawLine(12,6,12,8, GRAPHICS_NOR); //ROW 12
- delay(40);
- dmd.drawFilledBox (13,0,15,15, GRAPHICS_NOR);
- dmd.drawFilledBox (14,0,16,15, GRAPHICS_NORMAL);
- dmd.drawLine(13,5,13,9, GRAPHICS_NOR); //ROW 13
- delay(40);
- dmd.drawFilledBox (14,0,16,15, GRAPHICS_NOR);
- dmd.drawFilledBox (15,0,17,15, GRAPHICS_NORMAL);
- dmd.drawLine(14,5,14,9, GRAPHICS_NOR); //ROW 14
- delay(40);
- dmd.drawFilledBox (15,0,17,15, GRAPHICS_NOR);
- dmd.drawFilledBox (16,0,18,15, GRAPHICS_NORMAL);
- dmd.drawLine(15,5,15,9, GRAPHICS_NOR); //ROW 15
- delay(40);
- dmd.drawFilledBox (16,0,18,15, GRAPHICS_NOR);
- dmd.drawFilledBox (17,0,19,15, GRAPHICS_NORMAL);
- dmd.drawLine(16,5,16,9, GRAPHICS_NOR); //ROW 16
- delay(40);
- dmd.drawFilledBox (17,0,19,15, GRAPHICS_NOR);
- dmd.drawFilledBox (18,0,20,15, GRAPHICS_NORMAL);
- dmd.drawLine(17,5,17,9, GRAPHICS_NOR); //ROW 17
- delay(40);
- dmd.drawFilledBox (18,0,20,15, GRAPHICS_NOR);
- dmd.drawFilledBox (19,0,21,15, GRAPHICS_NORMAL);
- dmd.drawLine(18,6,18,8, GRAPHICS_NOR); //ROW 18
- delay(40);
- dmd.drawFilledBox (19,0,21,15, GRAPHICS_NOR);
- dmd.drawFilledBox (20,0,22,15, GRAPHICS_NORMAL);
- dmd.drawLine(19,6,19,8, GRAPHICS_NOR); //ROW 19
- delay(40);
- dmd.drawFilledBox (20,0,22,15, GRAPHICS_NOR);
- dmd.drawFilledBox (21,0,23,15, GRAPHICS_NORMAL);
- dmd.drawLine(20,6,20,8, GRAPHICS_NOR); //ROW 20
- delay(40);
- dmd.drawFilledBox (21,0,23,15, GRAPHICS_NOR);
- dmd.drawFilledBox (22,0,24,15, GRAPHICS_NORMAL);
- dmd.drawLine(21,6,21,8, GRAPHICS_NOR); //ROW 21
- delay(40);
- dmd.drawFilledBox (22,0,24,15, GRAPHICS_NOR);
- dmd.drawFilledBox (23,0,25,15, GRAPHICS_NORMAL);
- dmd.drawLine(22,6,22,8, GRAPHICS_NOR); //ROW 22
- delay(40);
- dmd.drawFilledBox (23,0,25,15, GRAPHICS_NOR);
- dmd.drawFilledBox (24,0,26,15, GRAPHICS_NORMAL);
- dmd.drawLine(23,6,23,8, GRAPHICS_NOR); //ROW 23
- delay(40);
- dmd.drawFilledBox (24,0,26,15, GRAPHICS_NOR);
- dmd.drawFilledBox (25,0,27,15, GRAPHICS_NORMAL);
- dmd.drawLine(24,6,24,8, GRAPHICS_NOR); //ROW 24
- delay(40);
- dmd.drawFilledBox (25,0,27,15, GRAPHICS_NOR);
- dmd.drawFilledBox (26,0,28,15, GRAPHICS_NORMAL);
- dmd.drawLine(25,6,25,8, GRAPHICS_NOR); //ROW 25
- delay(40);
- dmd.drawFilledBox (26,0,28,15, GRAPHICS_NOR);
- dmd.drawFilledBox (27,0,29,15, GRAPHICS_NORMAL);
- dmd.drawLine(26,6,26,8, GRAPHICS_NOR); //ROW 26
- delay(40);
- dmd.drawFilledBox (27,0,29,15, GRAPHICS_NOR);
- dmd.drawFilledBox (28,0,30,15, GRAPHICS_NORMAL);
- dmd.writePixel (27,7, GRAPHICS_NOR, 1); //ROW 27
- delay(40);
- dmd.drawFilledBox (28,0,30,15, GRAPHICS_NOR);
- dmd.drawFilledBox (29,0,31,15, GRAPHICS_NORMAL);
- dmd.writePixel (28,7, GRAPHICS_NOR, 1); //ROW 28
- delay(40);
- dmd.drawFilledBox (29,0,31,15, GRAPHICS_NOR);
- dmd.drawFilledBox (30,0,31,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawFilledBox (30,0,31,15, GRAPHICS_NOR);
- dmd.drawLine(31,0,31,15, GRAPHICS_NORMAL);
- delay(40);
- dmd.drawLine(31,0,31,15, GRAPHICS_NOR);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement