![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
7 julaa
Dependencies: mbed LCD_DISCO_F469NIa SD_DISCO_F469NI BSP_DISCO_F469NIa EEPROM_DISCO_F469NI
Diff: screen_library.cpp
- Revision:
- 4:0e8413277df8
- Parent:
- 3:a06e417a5a2c
- Child:
- 5:4b63e6845a8e
diff -r a06e417a5a2c -r 0e8413277df8 screen_library.cpp --- a/screen_library.cpp Thu Jul 05 20:18:32 2018 +0000 +++ b/screen_library.cpp Sat Jul 07 14:42:17 2018 +0000 @@ -8,12 +8,12 @@ extern GEAR *Gears; extern IMAGE LogoBig,LogoSmall,Branko,NewYearCongat; -extern uint16_t Rpm0, Speed0, Gear0, Water_Temp0, Oil_Temp0, TPS0, Brakes0, Oil_P0, MAP0, Air_Temp0, Lambda0, Volts0, Crank0; -extern uint16_t Rpm, Speed, Gear, Water_Temp, Oil_Temp, TPS, Brakes, Oil_P, MAP, Air_Temp, Lambda, Volts, Crank; +extern uint16_t Rpm0, Speed0, Gear0, Water_Temp0, Oil_Temp0, TPS0, Brakes0, MAP0, Air_Temp0, Lambda0, Volts0, Crank0; +extern uint16_t Rpm, Speed, Gear, Water_Temp, Oil_Temp, TPS, Brakes, MAP, Air_Temp, Lambda, Volts, Crank; 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; +//extern float Meter_counter,Meter_counter0; void ChangeCommand(){ //Interrupt function for registering change command change_flag=1; @@ -43,17 +43,6 @@ void SetIntro(){ // Set Intro screen DrawRGBImage(LogoBig,0,0); wait(1); - DrawRGBImage(Branko,250,50); - wait(3); - /*lcd.SetTextColor(LCD_COLOR_WHITE); - lcd.FillRect(0,0,800,480); - PrintString(" Srecnu Novu godinu ",50,70,50,LCD_COLOR_RED); - PrintString(" i Bozicne praznike ",50,80,110,LCD_COLOR_RED); - PrintString(" zeli Vam ",50,70,170,LCD_COLOR_RED); - PrintString("Podtim za Elektroniku",50,50,230,LCD_COLOR_RED); - wait(5); - DrawRGBImage(NewYearCongat,0,0); - wait(10);*/ }; void SetMain(){ // Set Main screen @@ -89,28 +78,26 @@ lcd.FillRect(0,0,800,480); lcd.SetTextColor(LCD_COLOR_BLACK); //Draw First Auxiliary screen - PrintString("Oil P",50,20,30,LCD_COLOR_BLACK); + PrintString("RPM",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,500,210,LCD_COLOR_BLACK); - PrintString("V",50,470,270,LCD_COLOR_BLACK); - PrintString("km",50,550,390,LCD_COLOR_BLACK); + PrintString("Distance:",50,20,330,LCD_COLOR_BLACK); + //PrintString("",50,470,30,LCD_COLOR_BLACK); + PrintString("kPa",50,560,90,LCD_COLOR_BLACK); + PrintString("C",50,560,150,LCD_COLOR_BLACK); + PrintString("Ratio",50,560,210,LCD_COLOR_BLACK); + PrintString("V",50,560,270,LCD_COLOR_BLACK); + PrintString("km",50,560,330,LCD_COLOR_BLACK); DrawRGBImage(LogoSmall,LogoSmallXPos,LogoSmallYPos); //Display initial values - SetNumber(Oil_P,50,OilPXPos,OilPYPos,3,0,0); + SetNumber(Rpm,50,RpmXPos,RpmYPos,5,0,0); SetNumber(MAP,50,MAPXPos,MAPYPos,3,0,0); SetNumber(Air_Temp,50,AirTempXPos,AirTempYPos,3,0,0); SetNumber(Lambda,50,LambdaXPos,LambdaYPos,4,1,0); SetNumber(Volts,50,VoltsXPos,VoltsYPos,3,2,0); - ChangeCrank(Crank); - SetNumber((int)(Meter_counter/10),50,Meter_counterXPos,Meter_counterYPos,5,3,0); + //SetNumber((int)(Meter_counter/10),50,Meter_counterXPos,Meter_counterYPos,5,3,0); }; @@ -151,7 +138,7 @@ break; }; if(Speed!=Speed0){ //Check is value is changed. If it is then update it on screen. - UpdateSpeedMeter(Speed0,Speed-Speed0); + UpdateSpeedMeter(Speed0/10,(Speed-Speed0)/10); }; if(Gear!=Gear0){ PrintChar(Gears[Gear],GearXPos,GearYPos,LCD_COLOR_BLACK); @@ -172,8 +159,8 @@ void FirstAuxUpdate(){ // Update information in First Auxiliary screen - if (Oil_P!=Oil_P0){ - ChangeNumber(Oil_P,Oil_P0,50,OilPXPos,OilPYPos,3,0,0); + if (Rpm!=Rpm0){ + ChangeNumber(Rpm,Rpm0,50,RpmXPos,RpmYPos,5,0,0); }; if (MAP!=MAP0){ ChangeNumber(MAP,MAP0,50,MAPXPos,MAPYPos,3,0,0); @@ -187,12 +174,9 @@ if (Volts!=Volts0){ ChangeNumber(Volts,Volts0,50,VoltsXPos,VoltsYPos,3,2,0); }; - 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); - }; + //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