15.02.2019. revision
Dependencies: mbed LCD_DISCO_F469NIa SD_DISCO_F469NI BSP_DISCO_F469NIa EEPROM_DISCO_F469NI
Diff: screen_library.cpp
- Revision:
- 2:f54f01527ebb
- Parent:
- 0:38c3afd99aeb
- Child:
- 3:a06e417a5a2c
diff -r ed6a402be3e3 -r f54f01527ebb screen_library.cpp --- a/screen_library.cpp Wed May 16 14:55:13 2018 +0000 +++ b/screen_library.cpp Thu Jun 28 16:33:23 2018 +0000 @@ -13,6 +13,7 @@ extern int FL_LVDT0, FR_LVDT0, RL_LVDT0, RR_LVDT0, FL_LVDT, FR_LVDT, RL_LVDT, RR_LVDT; extern int FL_LVDT_Ref,FR_LVDT_Ref,RL_LVDT_Ref,RR_LVDT_Ref; extern int LVDT_Max; +extern float Meter_counter,Meter_counter0; void ChangeCommand(){ //Interrupt function for registering change command change_flag=1; @@ -86,17 +87,19 @@ lcd.FillRect(0,0,800,480); lcd.SetTextColor(LCD_COLOR_BLACK); //Draw First Auxiliary screen - PrintString("Oil P",50,20,25,LCD_COLOR_BLACK); - PrintString("MAP",50,20,100,LCD_COLOR_BLACK); - PrintString("Air Temp",50,20,175,LCD_COLOR_BLACK); - PrintString("Lambda",50,20,250,LCD_COLOR_BLACK); - PrintString("Volts",50,20,325,LCD_COLOR_BLACK); - PrintString("Crank",50,20,400,LCD_COLOR_BLACK); - PrintString("kPa",50,470,25,LCD_COLOR_BLACK); - PrintString("kPa",50,470,100,LCD_COLOR_BLACK); - PrintString("C",50,470,175,LCD_COLOR_BLACK); - PrintString("Ratio",50,470,250,LCD_COLOR_BLACK); - PrintString("V",50,470,325,LCD_COLOR_BLACK); + PrintString("Oil P",50,20,30,LCD_COLOR_BLACK); + PrintString("MAP",50,20,90,LCD_COLOR_BLACK); + PrintString("Air Temp",50,20,150,LCD_COLOR_BLACK); + PrintString("Lambda",50,20,210,LCD_COLOR_BLACK); + PrintString("Volts",50,20,270,LCD_COLOR_BLACK); + PrintString("Crank",50,20,330,LCD_COLOR_BLACK); + PrintString("Distance:",50,20,390,LCD_COLOR_BLACK); + PrintString("kPa",50,470,30,LCD_COLOR_BLACK); + PrintString("kPa",50,470,90,LCD_COLOR_BLACK); + PrintString("C",50,470,150,LCD_COLOR_BLACK); + PrintString("Ratio",50,470,210,LCD_COLOR_BLACK); + PrintString("V",50,470,270,LCD_COLOR_BLACK); + PrintString("km",50,550,390,LCD_COLOR_BLACK); DrawRGBImage(LogoSmall,LogoSmallXPos,LogoSmallYPos); //Display initial values SetNumber(Oil_P,50,OilPXPos,OilPYPos,3,0,0); @@ -104,7 +107,8 @@ SetNumber(Air_Temp,50,AirTempXPos,AirTempYPos,3,0,0); SetNumber(Lambda,50,LambdaXPos,LambdaYPos,3,0,0); SetNumber(Volts,50,VoltsXPos,VoltsYPos,3,0,0); - ChangeCrank(Crank); + ChangeCrank(Crank); + SetNumber((int)(Meter_counter/10),50,Meter_counterXPos,Meter_counterYPos,5,3,0); }; @@ -184,6 +188,9 @@ if (Crank!=Crank0){ ChangeCrank(Crank); }; + if (Meter_counter!=Meter_counter0){ + ChangeNumber((int)(Meter_counter/10),(int)(Meter_counter0/10),50,Meter_counterXPos,Meter_counterYPos,5,3,0); + }; }; void SecondAuxUpdate(){ // Update information in Second Auxiliary screen