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 13:40:53 2014 +0000
Parent:
190:6fe36ef485ca
Child:
192:1d5f0ee9dc59
Commit message:
// Added in-car dim control;

Changed in this revision

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
--- a/displayModes.cpp	Sun May 18 13:29:08 2014 +0000
+++ b/displayModes.cpp	Sun May 18 13:40:53 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	Sun May 18 13:29:08 2014 +0000
+++ b/main.cpp	Sun May 18 13:40:53 2014 +0000
@@ -9,9 +9,9 @@
 // * 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 in 9341 controller option
-// rev188
-// Added support for new controller with pre-compiler directive
+
+// rev191
+// Added in-car dim control
 
 // Include this before other header files
 #include "precompile.h"
@@ -25,7 +25,7 @@
 #include "displayModes.h"
 #include "TOUCH_TFTx2.h"
 
-char revStr[7] = "188";
+char revStr[7] = "191";
 unsigned long maxTarget = 1000;
 FATFS USBdrive;
 LocalFileSystem local("local");
@@ -697,6 +697,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
                                 }                            
@@ -762,6 +770,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
                                 }