SCLD peripheral of the KL46Z - with sign "-" just for USB Academy

Dependents:   KL46Z-Lab2_lodz KL46Z-Lab2_fullll KL46Z-Lab2_szkolenie kL46Z-Lab3-lodz ... more

Fork of SLCD by Erik -

Files at this revision

API Documentation at this revision

Comitter:
liborgecnuk
Date:
Sun Mar 23 23:25:08 2014 +0000
Parent:
8:99e4215cfc11
Commit message:
'-' sign added for printing '-999'..' -1'..' 0'..' 999' used to print compass angle -180..180 degree with printf("% 3.0f", sD.magHeading);'

Changed in this revision

SLCD.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/SLCD.cpp	Fri Mar 14 15:31:39 2014 +0000
+++ b/SLCD.cpp	Sun Mar 23 23:25:08 2014 +0000
@@ -81,6 +81,7 @@
     ( SEGD+!SEGE+!SEGF+!SEGG) , (!SEGC+!SEGB+ SEGA) ,//Char = ^,   offset=184
     ( SEGD+!SEGE+!SEGF+!SEGG) , (!SEGC+!SEGB+ SEGA) ,//Char = _,   offset=188
     ( SEGD+!SEGE+!SEGF+!SEGG) , (!SEGC+!SEGB+ SEGA) ,//Char = `,   offset=192
+    (!SEGD+!SEGE+!SEGF+ SEGG) , (!SEGC+!SEGB+!SEGA) ,//Char = -,   offset=196 //LG+ added '-'
 };
 
 SLCD::SLCD()
@@ -175,8 +176,10 @@
         lbValue -= 32; // UpperCase
     }
     if (lbValue<ASCCI_TABLE_START || lbValue >ASCCI_TABLE_END) {
+      if (lbValue!='-') //LG+
         lbValue = BLANK_CHARACTER;  // default value as space
     }
+    if(lbValue=='-') lbValue += (-ASCCI_TABLE_START+3+(196)/4); else //LG+
     lbValue -=ASCCI_TABLE_START;        // Remove the offset to search in the ascci table
     arrayOffset = (lbValue * _CHAR_SIZE); // Compensate matrix offset
     // ensure bLCD position is in valid limit