From 87417ee9742b67d53b32f5c65776da45680cf874 Mon Sep 17 00:00:00 2001 From: jprodgers Date: Fri, 29 May 2015 16:16:29 +0200 Subject: [PATCH] Grayscale fading and brightness changes. Fixed the basic test code to run single brightness level by default, added the option of the grayscale fading, and slowed it way the hell down. --- ...oLShield_BasicTest.pde => LoLShield_BasicTest.ino} | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) rename examples/LoLShield_BasicTest/{LoLShield_BasicTest.pde => LoLShield_BasicTest.ino} (96%) diff --git a/examples/LoLShield_BasicTest/LoLShield_BasicTest.pde b/examples/LoLShield_BasicTest/LoLShield_BasicTest.ino similarity index 96% rename from examples/LoLShield_BasicTest/LoLShield_BasicTest.pde rename to examples/LoLShield_BasicTest/LoLShield_BasicTest.ino index e18688b..d9a8909 100644 --- a/examples/LoLShield_BasicTest/LoLShield_BasicTest.pde +++ b/examples/LoLShield_BasicTest/LoLShield_BasicTest.ino @@ -33,7 +33,9 @@ //Initialized in setup. //Sets the time each frame is shown (milliseconds) -const unsigned int blinkdelay = 1000 / 50; +const unsigned int blinkdelay = 75; +boolean fadeMode = false; +byte brightness = 7; //Brightness goes from 0-7 /* The BitMap array is what contains the frame data. Each line is one full frame. @@ -128,11 +130,14 @@ PROGMEM const uint16_t BitMap[][9] = { }; void setup() { - LedSign::Init(DOUBLE_BUFFER | GRAYSCALE); //Initializes the screen + LedSign::Init(GRAYSCALE); //Initializes the screen } void loop() { - for (uint8_t gray = 1; gray < SHADES; gray++) + + if(fadeMode) + for (uint8_t gray = 1; gray < SHADES; gray++) DisplayBitMap(gray); //Displays the bitmap + else DisplayBitMap(brightness); //Displays the bitmap } void DisplayBitMap(uint8_t grayscale)