Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- RANDOM AWESOME PIXELS AND TEXT!
- by Justin Rossetti
- */
- #include <RGB_GLCD.h>
- GLCD myGLCD; // Declare an instance of the class
- void setup()
- {
- randomSeed(analogRead(0));
- myGLCD.initLCD(); // Setup the LCD
- // myGLCD.clrScr(); // clear the screen
- }
- void loop()
- {
- myGLCD.clrScr();
- int rArray[]={255, 0, 0, 255, 255};
- int gArray[]={0, 255, 0, 255, 255};
- int bArray[]={0, 0, 255, 0, 255};
- int z,r,g,b;
- // Draw some random pixels
- for (z=0; z < 5; z = z+1)
- {
- r = rArray[z];
- g = gArray[z];
- b = bArray[z];
- for (int i=0; i<100; i++)
- {
- myGLCD.setColor(r,g,b);
- myGLCD.drawPixel(random(128), random(128));
- }
- }
- // Set up the flashing text
- myGLCD.setColor(0,0,0);
- myGLCD.fillRoundRect(15, 56, 113, 70);
- for (int i=0; i<4; i++)
- {
- myGLCD.setColor(255,255,255);
- myGLCD.print("finished.", CENTER, 60);
- delay (750);
- myGLCD.setColor(255,0,0);
- myGLCD.print("finished.", CENTER, 60);
- delay (750);
- }
- delay(1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement