- udpated to 8bit colors and included more arguments on show window function

master
Steve Clement 2013-07-30 11:52:59 +02:00
parent c50d38ab7e
commit b877700231
1 changed files with 53 additions and 50 deletions

View File

@ -15,94 +15,107 @@ RGBmatrixPanel matrix(A, B, C, CLK, LAT, OE, false);
void setup() { void setup() {
matrix.begin(); matrix.begin();
//myWindows(random(1,21));
int window = 13;
int brightness = 255;
int del = 100;
// White is 7,7,7 (3bit) 255,255,255 (8bit)
uint8_t red=255, green=255, blue=255;
while ( true ) {
myWindows(16, brightness, red, green, blue);
delay(del);
// fill the screen with 'black'
matrix.fillScreen(matrix.Color888(0, 0, 0));
matrix.swapBuffers(false);
} }
int myWindows (int w, int br){ }
// White is 7,7,7
uint8_t r=7, g=7, b=7;
int myWindows (int w, int br, int r, int g, int b){
switch (w) { switch (w) {
case 1: case 1:
// Window 1 // Window 1
matrix.fillRect(1,12,4,3, matrix.Color333(r,g,b)); matrix.fillRect(1,12,4,3, matrix.Color888(r,g,b));
break; break;
case 2: case 2:
// Window 2 // Window 2
matrix.fillRect(7,12,4,3, matrix.Color333(r,g,b)); matrix.fillRect(7,12,4,3, matrix.Color888(r,g,b));
break; break;
case 3: case 3:
// Window 3 // Window 3
matrix.fillRect(13,12,4,3, matrix.Color333(r,g,b)); matrix.fillRect(13,12,4,3, matrix.Color888(r,g,b));
break; break;
case 4: case 4:
// Window 4 // Window 4
matrix.fillRect(19,12,4,3, matrix.Color333(r,g,b)); matrix.fillRect(19,12,4,3, matrix.Color888(r,g,b));
break; break;
case 5: case 5:
// Window 5 // Window 5
matrix.fillRect(25,12,4,3, matrix.Color333(r,g,b)); matrix.fillRect(25,12,4,3, matrix.Color888(r,g,b));
break; break;
case 6: case 6:
// Window 5 // Window 6
matrix.fillRect(1,8,4,3, matrix.Color333(r,g,b)); matrix.fillRect(1,8,4,3, matrix.Color888(r,g,b));
break; break;
case 7: case 7:
// Window 5 // Window 7
matrix.fillRect(7,8,4,3, matrix.Color333(r,g,b)); matrix.fillRect(7,8,4,3, matrix.Color888(r,g,b));
break; break;
case 8: case 8:
// Window 5 // Window 8
matrix.fillRect(13,8,4,3, matrix.Color333(r,g,b)); matrix.fillRect(13,8,4,3, matrix.Color888(r,g,b));
break; break;
case 9: case 9:
// Window 5 // Window 9
matrix.fillRect(19,8,4,3, matrix.Color333(r,g,b)); matrix.fillRect(19,8,4,3, matrix.Color888(r,g,b));
break; break;
case 10: case 10:
// Window 5 // Window 10
matrix.fillRect(25,8,4,3, matrix.Color333(r,g,b)); matrix.fillRect(25,8,4,3, matrix.Color888(r,g,b));
break; break;
case 11: case 11:
// Window 5 // Window 11
matrix.fillRect(1,4,4,3, matrix.Color333(r,g,b)); matrix.fillRect(1,4,4,3, matrix.Color888(r,g,b));
break; break;
case 12: case 12:
// Window 5 // Window 12
matrix.fillRect(7,4,4,3, matrix.Color333(r,g,b)); matrix.fillRect(7,4,4,3, matrix.Color888(r,g,b));
break; break;
case 13: case 13:
// Window 5 // Window 13
matrix.fillRect(13,4,4,3, matrix.Color333(r,g,b)); matrix.fillRect(13,4,4,3, matrix.Color888(r,g,b));
break; break;
case 14: case 14:
// Window 5 // Window 14
matrix.fillRect(19,4,4,3, matrix.Color333(r,g,b)); matrix.fillRect(19,4,4,3, matrix.Color888(r,g,b));
break; break;
case 15: case 15:
// Window 5 // Window 15
matrix.fillRect(25,4,4,3, matrix.Color333(r,g,b)); matrix.fillRect(25,4,4,3, matrix.Color888(r,g,b));
break; break;
case 16: case 16:
// Window 5 // Window 16
matrix.fillRect(1,0,4,3, matrix.Color333(r,g,b)); matrix.fillRect(1,0,4,3, matrix.Color888(r,g,b));
break; break;
case 17: case 17:
// Window 5 // Window 17
matrix.fillRect(7,0,4,3, matrix.Color333(r,g,b)); matrix.fillRect(7,0,4,3, matrix.Color888(r,g,b));
break; break;
case 18: case 18:
// Window 5 // Window 18
matrix.fillRect(13,0,4,3, matrix.Color333(r,g,b)); matrix.fillRect(13,0,4,3, matrix.Color888(r,g,b));
break; break;
case 19: case 19:
// Window 5 // Window 19
matrix.fillRect(19,0,4,3, matrix.Color333(r,g,b)); matrix.fillRect(19,0,4,3, matrix.Color888(r,g,b));
break; break;
case 20: case 20:
// Window 5 // Window 20
matrix.fillRect(25,0,4,3, matrix.Color333(r,g,b)); matrix.fillRect(25,0,4,3, matrix.Color888(r,g,b));
break; break;
default: default:
@ -112,15 +125,5 @@ switch (w) {
void loop() { void loop() {
// do nothing // do nothing
//myWindows(random(1,21));
int window = 13;
int brightness = 255;
myWindows(window, brightness);
int del = 100;
delay(del);
// fill the screen with 'black'
matrix.fillScreen(matrix.Color333(0, 0, 0));
matrix.swapBuffers(false);
} }