test fork
Dependencies: SPI_TFTx2 SPI_TFTx2_ILI9341 TFT_fonts TOUCH_TFTx2 mbed
Fork of CANary_9341 by
Diff: displayModes.cpp
- Revision:
- 144:b0c9d30dd346
- Parent:
- 143:88b5155622a5
- Child:
- 148:6e3b9135fad2
diff -r 88b5155622a5 -r b0c9d30dd346 displayModes.cpp --- a/displayModes.cpp Mon Aug 05 03:34:06 2013 +0000 +++ b/displayModes.cpp Tue Aug 06 01:26:17 2013 +0000 @@ -35,11 +35,6 @@ tt.locate(16,10); tt.foreground(White); printf("%3d gids \n",gids); - if(debugMode){ - if(pointerSep>maxPS){maxPS=pointerSep;} - tt.locate(10,70); - printf("%3d sep %3d max\n",pointerSep,maxPS); - } tt.locate(10,40); tt.foreground(Cyan); useable_kWh = (float)(gids-5)*0.075; @@ -47,6 +42,11 @@ useable_kWh=0; } printf("%4.1f kWh \n",useable_kWh); + if(debugMode){ + if(pointerSep>maxPS){maxPS=pointerSep;} + tt.locate(10,110); + printf("%3d sep %3d max\n",pointerSep,maxPS); + } // Display DTE dte=convertDistance(minTripEff*useable_kWh); @@ -145,7 +145,11 @@ if(force||accV!=laccV){ tt.locate(20,176); tt.foreground(Yellow); - printf("%3.1f(%3.1f) \n",accV,accV2); + if(debugMode){ + printf("%4.2f %4.2f \n",accV,accV2); + }else{ + printf("%3.1fV \n",accV); + } laccV=accV; } if(force||tireP!=ltireP){ @@ -422,10 +426,6 @@ short steerOutBounds = 0 ; CANMessage msg; -// tt.set_font((unsigned char*) Arial12x12_prop); // select the font -// tt.locate(10,40); -// printf("%d \n",chirpInt); - //--------------- msg = lastMsg[indexLastMsg[0x180]]; //Get Throttle position throttle = msg.data[5]; @@ -1112,7 +1112,6 @@ toVal=24;// no need to constantly update the long tc values } if(force||lgids!=gids){ // update Y axis when kWh changes - //tt.set_font((unsigned char*) Arial12x12); tt.set_font((unsigned char*) Arial24x23); //for(i=0;i<10;i++){ //y=200-i*20; @@ -1121,7 +1120,6 @@ tt.locate(0,y-8); if (showMiles){ printf("%3.0f\n",convertDistance(i*((float)(gids-5)*.075))); // LM - Added metric support - //printf("%2.0f \n",i*((float)(gids-5)*.075)); }else{ printf("%d.0\n",i); } @@ -1170,6 +1168,10 @@ } else { tt.locate(200,10); printf("%3.1f \n",mpkWh[dtePeriod]); + tt.foreground(Cyan); + tt.set_font((unsigned char*) Arial24x23); + tt.locate(222,70); + printf("%2.1f \n",curEff); } lx=50; ly=mpkWh[0]*40;