Tick Tock / Mbed 2 deprecated CANary

Dependencies:   SPI_TFTx2_ILI9341 TFT_fonts TOUCH_TFTx2_ILI9341 mbed

Fork of CANary_corrupt by Tick Tock

Files at this revision

API Documentation at this revision

Comitter:
TickTock
Date:
Sun May 18 04:48:20 2014 +0000
Parent:
186:69cc7adc29a3
Commit message:
Added LED dim/bright control

Changed in this revision

SPI_TFTx2_ILI9341.lib Show diff for this revision Revisions of this file
displayModes.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
utility.h Show annotated file Show diff for this revision Revisions of this file
--- a/SPI_TFTx2_ILI9341.lib	Mon May 12 00:55:19 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/TickTock/code/SPI_TFTx2_ILI9341/#66cf46ec1225
--- a/displayModes.cpp	Mon May 12 00:55:19 2014 +0000
+++ b/displayModes.cpp	Sun May 18 04:48:20 2014 +0000
@@ -992,7 +992,7 @@
         sprintf(sTemp1,"Enable");
     }
     showButton(2,1,sTemp1,"Batt Log",4,4);
-
+    showButton(3,1,"  LED","   up",4,4);
     //------- third row -----
     if(brakeMon)
         showButton(0,2,"Disable","BrkMon",4,4);
@@ -1008,7 +1008,7 @@
         showButton(2,2,"Disable","HeatMon",4,4);
     else
         showButton(2,2," Enable","HeatMon",4,4);
-
+    showButton(3,2,"  LED","  down",4,4);
 }
 
 void config2(bool force, bool showButtons){
--- a/main.cpp	Mon May 12 00:55:19 2014 +0000
+++ b/main.cpp	Sun May 18 04:48:20 2014 +0000
@@ -9,7 +9,7 @@
 // * Add tire pressure cal (40psi for me = FR 38, RR 38.2, FL 37.8, RL 38 - maybe 2psi error on my tire gauge?)
 // * Add on screen messages for heater on, etc, and use refresh feature above to clear in x seconds
 // * Be more efficient with write buffer (use msgLen instead of always storing 8 bytes)
-
+// * Merge with 9341
 // rev184
 // Fixed wh adjustment algorithm
 
@@ -691,6 +691,14 @@
                                 } else if ((dMode[whichTouched]==dateScreen)&&accOn){
                                     syncDone=false; // initiate clock sync
                                     lastDMode[whichTouched]=99;
+                                } else if (dMode[whichTouched]==configScreen) {
+                                    if(!headlights){
+                                        ledHi += 0.05;
+                                        if (ledHi>1.0) ledHi=1.0;
+                                    } else {
+                                        ledLo += 0.05;
+                                        if (ledLo>1.0) ledLo=1.0;
+                                    }
                                 } else {
                                     lastDMode[whichTouched]=99;//repaint to clear highlight
                                 }                            
@@ -756,6 +764,14 @@
                                 } else if (dMode[whichTouched]==dateScreen){
                                     autoSync=!autoSync; // toggle autoSync mode
                                     lastDMode[whichTouched]=99;
+                                } else if (dMode[whichTouched]==configScreen) {
+                                    if(!headlights){
+                                        ledHi -= 0.05;
+                                        if (ledHi<0) ledHi=0;
+                                    } else {
+                                        ledLo -= 0.05;
+                                        if (ledLo<0) ledLo=0;
+                                    }
                                 } else {                             
                                     lastDMode[whichTouched]=99;//repaint to clear highlight
                                 }
--- a/utility.h	Mon May 12 00:55:19 2014 +0000
+++ b/utility.h	Sun May 18 04:48:20 2014 +0000
@@ -162,7 +162,7 @@
 //12:   SPI:MISO
 //13:   SPI:SCLK
 //14:       NC:Ain
-//15:   MON12V     -->  4K to 12V, 1K to VSS  (To be implemented)
+//15:   MON12V     -->  4K to 12V, 1K to VSS
 //16:   TOUCH_X+
 //17:   TOUCH_X-
 //18:       NC:Aout