From 994108bc86fb8f8527431a5b1b8b29636e758895 Mon Sep 17 00:00:00 2001 From: ianatkin80 Date: Fri, 1 Jan 2016 12:41:24 +0000 Subject: [PATCH] Added brightness command Added $$$Q command to set screen brightness, value 1-127 --- LoLShield/examples/PI_LITE/PI_LITE.ino | 12 +++++++++++- LoLShield/examples/PI_LITE/readme.txt | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/LoLShield/examples/PI_LITE/PI_LITE.ino b/LoLShield/examples/PI_LITE/PI_LITE.ino index 1f3046c..5e1a7a9 100644 --- a/LoLShield/examples/PI_LITE/PI_LITE.ino +++ b/LoLShield/examples/PI_LITE/PI_LITE.ino @@ -1,13 +1,14 @@ /* Pi-Lite Copyright (c) 2013 Ciseco Ltd. - Code written by Ciseco Ltd. April 4th 2013 + Code written by Ciseco Ltd. April 4th 2013, modified by Ian Atkin, January 1st, 2016. 2013-04-04 - V0.2 Initial beta release for internal testing 2013-05-02 - V0.3 Added new commands - scroll and display character Added brief flash of a cross at startup 2013-05-03 - V1 updated startup and added logo V1.1 Corrected scroll command 2013-05-07 V1.2 Fixed the $$$P command - had the wrong limits for column and row. + 2016-01-01 - V1.3 Added brightness control command $$$Q (value 1 (dim) to 127 (bright) Please see Readme.txt for details on the code functionality @@ -21,6 +22,7 @@ Created by Alex Wenger, December 30, 2009. Modified by Matt Mets, May 28, 2010. Modified by Ciseco Ltd. April 4th 2013 + Modified by Ian Atkin, January 1st, 2016. */ @@ -56,6 +58,7 @@ int scrollDelay = 80; uint32_t timer1; uint8_t init_stage=0; uint8_t init_pos; +uint8_t brightness; uint16_t logo[14] = {0b111100000,0b101011111,0b111000001, 0b000000001,0b101100000,0b000011111, @@ -483,6 +486,13 @@ void processCommandChar(char c) pinMode(14,OUTPUT); digitalWrite(14,HIGH); break; + case 'Q': // Qval - Brightness - set overall screen brightness to val (1 (dim) to 127 (bright)) + brightness = atoi(commandbuffer); + if (brightness > 0 && brightness <= 127) + { + LedSign::SetBrightness(brightness); + } + break; default: // not a valid command break; } diff --git a/LoLShield/examples/PI_LITE/readme.txt b/LoLShield/examples/PI_LITE/readme.txt index bbf1477..e0b42c6 100644 --- a/LoLShield/examples/PI_LITE/readme.txt +++ b/LoLShield/examples/PI_LITE/readme.txt @@ -32,3 +32,4 @@ $$$ALL,ON - set all pixels on $$$ALL,OFF - set all pixels off $$$SCROLLval - Scroll val columns left (val is positive) or right (val is negative) $$$Tc,r,char - display char at c,r +$$$Qval Set screen brightness (1 is dim, 127 is bright) \ No newline at end of file