Charliecube
What is it? |
How is it Built? |
How is it Programed? |
Downloads |
Wire Number | Arduino Pin | AVR Pin |
---|---|---|
1 | Digital 2 | Port D - Pin 2 [PD2] |
2 | Digital 3 | Port D - Pin 3 [PD3] |
3 | Digital 4 | Port D - Pin 4 [PD4] |
4 | Digital 5 | Port D - Pin 5 [PD5] |
5 | Digital 6 | Port D - Pin 6 [PD6] |
6 | Digital 7 | Port D - Pin 7 [PD7] |
7 | Digital 8 | Port B - Pin 0 [PB0] |
8 | Digital 9 | Port B - Pin 1 [PB1] |
9 | Digital 10 | Port B - Pin 2 [PB2] |
10 | Digital 11 | Port B - Pin 3 [PB3] |
11 | Digital 12 | Port B - Pin 4 [PB4] |
12 | Digital 13 | Port B - Pin 5 [PB5] |
13 | Analog 0 (Digital 14) | Port C - Pin 0 [PC0] |
14 | Analog 1 (Digital 15) | Port C - Pin 1 [PC1] |
15 | Analog 2 (Digital 16) | Port C - Pin 2 [PC2] |
16 | Analog 3 (Digital 17) | Port C - Pin 3 [PC3] |
drawLed() | drawBoxOutline() | drawHollowBox() | flushBuffer() |
drawBox() | drawBoxWalls() | drawLine() | clearBuffer() |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | #include "cubeplex.h" int color = red; void setup() { // initilize the cube display initCube(); // how many secconds until continuePattern is set to false animationMax = 10; } void loop() { randomLed(); } void randomLed(){ continuePattern = true ; int animationSpeed = 100; while (continuePattern) { int xpos = random(0,4); int ypos = random(0,4); int zpos = random(0,4); drawLed(color,xpos,ypos,zpos); flushBuffer(); clearBuffer(); delay(animationSpeed); } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | #include "cubeplex.h" void setup() { //initilize the cube display initCube(); // set the number of seconds until continuePattern is set to false animationMax = 10; } void loop() { bigBlueBox(); tinyGreenBox(); } void bigBlueBox() { continuePattern = true ; draw(blue,0,0,0,3,3,3); flushBuffer(); clearBuffer(); // do nothing while the pattern continues while (continuePattern); } void tinyGreenBox() { continuePattern = true ; drawBox(green,FULL,1,1,1,2,2,2); flushBuffer(); clearBuffer(); // loop until the pattern is done while (continuePattern); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | #include "cubeplex.h" int color = red; void setup() { // initilize the cube display initCube(); // set the number of seconds each animation should run for animationMax = 10; } void loop() { pulsingCube(); } void pulsingCube() { continuePattern = true ; int animationSpeed = 100; while (continuePattern) { for ( int i = 0; i < 4; i++) { drawHollowBox(color,0,0,0,i,i,i); flushBuffer(); clearBuffer(); delay(animationSpeed); } for ( int i = 0; i < 4; i++) { drawHollowBox(color,i,i,i,3,3,3); flushBuffer(); clearBuffer(); delay(animationSpeed); } color=nextColor(color); } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | #include "cubeplex.h" int color = red; void setup() { // initilize the cube display initCube(); // set the number of seconds each animation should run for animationMax = 10; } void loop() { pulsingCube(); } void pulsingCube() { continuePattern = true ; int animationSpeed = 100; while (continuePattern) { for ( int i = 0; i < 4; i++) { drawBoxOutline(color,0,0,0,i,i,i); flushBuffer(); clearBuffer(); delay(animationSpeed); } for ( int i = 0; i < 4; i++) { drawBoxOutline(color,i,i,i,3,3,3); flushBuffer(); clearBuffer(); delay(animationSpeed); } color=nextColor(color); } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | #include "cubeplex.h" int color = red; void setup() { // initilize the cube display initCube(); // set the number of seconds each animation should run for animationMax = 10; } void loop() { fountian(); } void fountian() { continuePattern = true ; int animationSpeed = 100; while (continuePattern) { for ( int z = 0; z <= 3; z++) { drawBoxWalls(color,1,1,z,2,2,z); flushBuffer(); clearBuffer(); delay(animationSpeed); } for ( int z = 3; z >= 0; z--) { drawBoxWalls(color,0,0,z,3,3,z); flushBuffer(); clearBuffer(); delay(animationSpeed); } color=nextColor(color); } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | #include "cubeplex.h" int color = red; void setup() { initCube; animationMax = 10; } void loop() { planarSpin(); } void planarSpin() { continuePattern = true ; int animationSpeed = 50; int spinsPerColor = 5; // a spin is actually half a revolution while (continuePattern) { int x = 0; int y = 0; for ( int i = 0; i < spinsPerColor; i++) { for ( int x = 0; x < 3; x++) { drawLine(color,x,0,0,3-x,3,0); drawLine(color,x,0,1,3-x,3,1); drawLine(color,x,0,2,3-x,3,2); drawLine(color,x,0,3,3-x,3,3); flushBuffer(); clearBuffer(); delay(animationSpeed); } for ( int y = 0; y < 3; y++) { drawLine(color,3,y,0,0,3-y,0); drawLine(color,3,y,1,0,3-y,1); drawLine(color,3,y,2,0,3-y,2); drawLine(color,3,y,3,0,3-y,3); flushBuffer(); clearBuffer(); delay(animationSpeed); } } color = nextColor(color); } } |
1 |
1 |