Skip to content

Commit

Permalink
Merge pull request #5 from javastraat/develop
Browse files Browse the repository at this point in the history
added battery and xmastree animations
  • Loading branch information
annejan committed Nov 14, 2014
2 parents b493466 + caf27ba commit c3c5c40
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 2 deletions.
62 changes: 62 additions & 0 deletions software/ijnimations/battery.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
battery animation by Einstein
*/
int battery() {
byte animation1[8] = {
B00111100, B01000010, B01000010, B01000010, B01000010, B01000010, B01000010, B01111110
};

byte animation2[8] = {
B00111100, B01000010, B01000010, B01000010, B01000010, B01000010, B01111110, B01111110
};

byte animation3[8] = {
B00111100, B01000010, B01000010, B01000010, B01000010, B01111110, B01111110, B01111110
};

byte animation4[8] = {
B00111100, B01000010, B01000010, B01000010, B01111110, B01111110, B01111110, B01111110
};

byte animation5[8] = {
B00111100, B01000010, B01000010, B01111110, B01111110, B01111110, B01111110, B01111110
};

byte animation6[8] = {
B00111100, B01000010, B01111110, B01111110, B01111110, B01111110, B01111110, B01111110
};

byte animation7[8] = {
B00111100, B01111110, B01111110, B01111110, B01111110, B01111110, B01111110, B01111110
};

bool skip = render(animation1, 500);
if (skip) {
return true;
}
skip = render(animation2, 500);
if (skip) {
return true;
}
skip = render(animation3, 500);
if (skip) {
return true;
}
skip = render(animation4, 500);
if (skip) {
return true;
}
skip = render(animation5, 500);
if (skip) {
return true;
}
skip = render(animation6, 500);
if (skip) {
return true;
}
skip = render(animation7, 500);
if (skip) {
return true;
}
return false;
}
5 changes: 3 additions & 2 deletions software/ijnimations/ijnimations.ino
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ LedControl lc=LedControl(20,5,21,1);
int lowPin = 11; /* ground pin for the buton ;-) */
int buttonPin = 9; /* choose the input pin for the pushbutton */

const int animations = 21;
const int animations = 23;
int (*ijnimations[animations])() = {
ijhacklogo, ghost, invader, heart, invadesquid, jumper, ijlogowink,
heartbeat, eq, invaderagain, pong, snake, arrows, directions,
packman, diagonals, waterdrip, aliens, blockanim, pulse, tewdoodles
packman, diagonals, waterdrip, aliens, blockanim, pulse, tewdoodles,
battery,xmastree
};

int lastButtonState = LOW; /* the previous reading from the input pin */
Expand Down
39 changes: 39 additions & 0 deletions software/ijnimations/xmastree.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
xmastree by Einstein
*/int xmastree() {
byte animation1[8] = {
B10011000,B00111100,B01111110,B11111111,B00111100,B01111110,B11111111,B00011000
};

byte animation2[8] = {
B00011001,B00111100,B01111110,B11111111,B00111100,B01111110,B11111111,B00011000
};

byte animation3[8] = {
B01011000,B00111100,B01111110,B11111111,B00111100,B01111110,B11111111,B00011000
};


byte animation4[8] = {
B00011010,B00111100,B01111110,B11111111,B00111100,B01111110,B11111111,B00011000
};


bool skip = render(animation1, 500);
if (skip) {
return true;
}
skip = render(animation2, 500);
if (skip) {
return true;
}
skip = render(animation3, 500);
if (skip) {
return true;
}
skip = render(animation4, 500);
if (skip) {
return true;
}
return false;
}

0 comments on commit c3c5c40

Please sign in to comment.