Allows for a 90 frame animated gauge to be display on the uLCD

Dependents:   uLCDgaugeTest

Files at this revision

API Documentation at this revision

Comitter:
Striker121
Date:
Fri Mar 13 14:05:32 2015 +0000
Parent:
0:9101c0ce36a1
Child:
2:38006c26dda5
Commit message:
Added command for custom gauge addresses

Changed in this revision

uLCD_gauges.cpp Show annotated file Show diff for this revision Revisions of this file
uLCD_gauges.h Show annotated file Show diff for this revision Revisions of this file
--- a/uLCD_gauges.cpp	Thu Mar 12 18:19:26 2015 +0000
+++ b/uLCD_gauges.cpp	Fri Mar 13 14:05:32 2015 +0000
@@ -7,9 +7,21 @@
     maxVal = max;
     mapOffset = 1;
     mapSlope = (90 - 1) / (maxVal - minVal);
+    memHigh = 0;
+    memLow = 0;
 }
  
+uLCD_gauges::uLCD_gauges(uLCD_4DGL& screen, float min, float max, long memoryAddressHigh, long memoryAddressLow){
+    uLCD = &screen;
+    minVal = min;
+    maxVal = max;
+    mapOffset = 1;
+    mapSlope = (90 - 1) / (maxVal - minVal);
+    memHigh = memoryAddressHigh;
+    memLow = memoryAddressLow;
+}
 void uLCD_gauges::start() {
+    uLCD->baudrate(3000000);
     uLCD->cls();
     uLCD->media_init();
     uLCD->set_sector_address(0,0);
--- a/uLCD_gauges.h	Thu Mar 12 18:19:26 2015 +0000
+++ b/uLCD_gauges.h	Fri Mar 13 14:05:32 2015 +0000
@@ -7,6 +7,7 @@
 class uLCD_gauges {
 public:
     uLCD_gauges(uLCD_4DGL& screen, float min, float max);
+    uLCD_gauges(uLCD_4DGL& screen, float min, float max, long memoryAddressHigh, long memoryAddressLow);
     void start();
     void update(float value);
   
@@ -16,6 +17,8 @@
     float maxVal;
     float mapOffset;
     float mapSlope;
+    long memHigh;
+    long memLow;
 };
  
 #endif