![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
7 jul
Dependencies: BSP_DISCO_F469NIa EEPROM_DISCO_F469NI LCD_DISCO_F469NIa SD_DISCO_F469NI mbed
Fork of IntegrationCAN_7jul by
Revision 4:0e8413277df8, committed 2018-07-07
- Comitter:
- formulas
- Date:
- Sat Jul 07 14:42:17 2018 +0000
- Parent:
- 3:a06e417a5a2c
- Commit message:
- 7 jul
Changed in this revision
--- a/CAN_library.cpp Thu Jul 05 20:18:32 2018 +0000 +++ b/CAN_library.cpp Sat Jul 07 14:42:17 2018 +0000 @@ -10,12 +10,12 @@ extern uint8_t distance_flag; extern uint8_t lvdtref; -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; +extern uint16_t Rpm, Speed, Gear, Water_Temp, Oil_Temp, TPS, Brakes, MAP, Air_Temp, Lambda, Volts; 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; -int LVDT_Max=150; -extern float Meter_counter,Meter_counter0; +int LVDT_Max=1024; +//extern float Meter_counter,Meter_counter0; extern char cmd[3]; extern int addr; extern I2C i2c; @@ -129,16 +129,16 @@ break; case(9): newData=AllocData(msgDistance); - if(distance_flag==0){ - InitDistanceMeter(newData); - distance_flag=1; - }; + //if(distance_flag==0){ + // InitDistanceMeter(newData); + // distance_flag=1; + //}; rx_flag = rx_flag ^ (1<<9); // for each new id add new case statement }; }; }; - UpdateMeterCounter(); + //UpdateMeterCounter(); }; uint16_t * AllocData(CANMessage msg){ //Unpack CAN message @@ -150,79 +150,76 @@ return newData; }; -void InitDistanceMeter(uint16_t newData[4]){ +/*void InitDistanceMeter(uint16_t newData[4]){ uint32_t DistanceBuffer; DistanceBuffer=(uint32_t)((newData[1]<<16) | (newData[0])); Meter_counter=float(DistanceBuffer)*10; - pc.printf("Init success, start km=%d,%f\n",DistanceBuffer,Meter_counter); + //pc.printf("Init success, start km=%d,%f\n",DistanceBuffer,Meter_counter); t_int.start(); t_store.start(); -}; -/*void InitDistanceMeter(){ - uint32_t distance_buffer; - if(sd.ReadBlocks((uint32_t*)distance_buffer,DISTANCE_MEMORY_ADDR ,1,SD_DATATIMEOUT)){ - Meter_counter=(float(distance_buffer))/100; - - -};*/ -/*void InitDistanceMeter(){ - - uint8_t DistanceBuffer8[4]; - uint32_t DistanceBuffer32; - if(eep.ReadBuffer(DistanceBuffer8, 0, (uint16_t*)4)){ - pc.printf("Read success\n"); - } - DistanceBuffer32=(DistanceBuffer8[0]<<24) | (DistanceBuffer8[1]<<16) | (DistanceBuffer8[2]<<8) | DistanceBuffer8[3]; - Meter_counter=(float(DistanceBuffer32))/100; - pc.printf("Meter_counter=%f\n",Meter_counter); };*/ + void UpdateInfoDTA1(uint16_t newData[4]){ //Update values for DTA1 message - Rpm0=Rpm; - Rpm=newData[0]; - showLedRpm(Rpm); - TPS0=TPS; - TPS=newData[1]; - Water_Temp0=Water_Temp; - Water_Temp=newData[2]; - Air_Temp0=Air_Temp; - Air_Temp=newData[3]; - //pc.printf("%d %d %d %d", Rpm, TPS,Water_Temp,Air_Temp); + if (newData[0]>0 && newData[0]<=13000){ + Rpm0=Rpm; + Rpm=newData[0]; + showLedRpm(Rpm); + }; + if (newData[1]>0 && newData[1]<100){ + TPS0=TPS; + TPS=newData[1]; + }; + if (newData[2]>0 && newData[2]<1000){ + Water_Temp0=Water_Temp; + Water_Temp=newData[2]; + }; + if (newData[3]>0 && newData[3]<1000){ + Air_Temp0=Air_Temp; + Air_Temp=newData[3]; + }; }; void UpdateInfoDTA2(uint16_t newData[4]){ //Update values for DTA2 message - MAP0=MAP; - MAP=newData[0]; - Lambda0=Lambda; - Lambda=newData[1]; - Speed0=Speed; - Speed=newData[2]; - Oil_P0=Oil_P; - Oil_P=newData[3]; - //pc.printf("MAP=%d, Lambda=%d, Speed=%d, Oil_P=%d\n",MAP,Lambda,Speed,Oil_P); + if (newData[0]>0 && newData[0]<200){ + MAP0=MAP; + MAP=newData[0]; + }; + if (newData[1]>0 && newData[2]<10000){ + Lambda0=Lambda; + Lambda=newData[1]; + }; + if (newData[2]>0 && newData[2]<1500){ + Speed0=Speed; + Speed=newData[2]; + }; }; void UpdateInfoDTA3(uint16_t newData[4]){ //Update values for DTA3 message - Oil_Temp0=Oil_Temp; - Oil_Temp=newData[1]; - Volts0=Volts; - Volts=newData[2]; + if (newData[1]>0 && newData[1]<200){ + Oil_Temp0=Oil_Temp; + Oil_Temp=newData[1]; + }; + if (newData[2]>0 && newData[2]<200){ + Volts0=Volts; + Volts=newData[2]; + }; }; void UpdateInfoDTA4(uint16_t newData[4]){ //Update values for DTA4 message - Gear0=Gear; - Gear=newData[0]; + if (newData[0]>0 && newData[0]<=6){ + Gear0=Gear; + Gear=newData[0]; + }; }; void UpdateInfoDTA5(uint16_t newData[4]){ //Update values for DTA5 message }; void UpdateInfoDTA6(uint16_t newData[4]){ //Update values for DTA6 message - Crank0=Crank; - Crank=newData[2]; }; -void UpdateMeterCounter(){ +/*void UpdateMeterCounter(){ float ti=t_int.read(); if(ti>0.1){ Meter_counter0=Meter_counter; @@ -243,17 +240,17 @@ }; t_store.reset(); - /*uint32_t distance_buffer; - //distance_buffer=uint32_t(Meter_counter) ; + uint32_t distance_buffer; + distance_buffer=uint32_t(Meter_counter) ; pc.printf("distance=%d\n",distance_buffer); distance_buffer=0xFF000000; if(sd.WriteBlocks((uint32_t*)distance_buffer,DISTANCE_MEMORY_ADDR,1,SD_DATATIMEOUT)){ pc.printf("Storage success\n"); }else{ pc.printf("Storage failed\n"); - };*/ + }; - /*uint32_t DistanceBuffer32; + uint32_t DistanceBuffer32; uint8_t DistanceBuffer8[4]; DistanceBuffer32=uint32_t(Meter_counter); DistanceBuffer8[0]=DistanceBuffer32>>24; @@ -262,7 +259,7 @@ DistanceBuffer8[3]=(DistanceBuffer32 & (uint32_t)0x000000FF); if(eep.WriteBuffer(DistanceBuffer8,0,4)){ pc.printf("Write success,Distance=%d\n",DistanceBuffer32); - };*/ + }; }; }; @@ -273,77 +270,80 @@ }else{ printf("Shit\n"); } -}; +};*/ void UpdateInfoLVDTFront(uint16_t newData[4]){ //Update values for LVDTFront message - FL_LVDT0=FL_LVDT; //LVDTs are firstly written their voltage value, then overwritten by calculated pertentage value. - FL_LVDT=newData[0]; - FR_LVDT0=FR_LVDT; - FR_LVDT=newData[1]; - if(!(lvdtref & (1<<3))){ //Check if its the first time LVDT value is received. If yes than store it as Referrent value. - if (FL_LVDT>FL_LVDT_Ref){ - FL_LVDT=(FL_LVDT-FL_LVDT_Ref)*100/(LVDT_Max-FL_LVDT_Ref); - }else{ - FL_LVDT=(FL_LVDT-FL_LVDT_Ref)*100/FL_LVDT_Ref; + if (newData[0]>0 && newData[0]<=1024){ + FL_LVDT0=FL_LVDT; //LVDTs are firstly written their voltage value, then overwritten by calculated pertentage value. + FL_LVDT=newData[0]; + if(!(lvdtref & (1<<3))){ //Check if its the first time LVDT value is received. If yes than store it as Referrent value. + if (FL_LVDT>FL_LVDT_Ref){ + FL_LVDT=(FL_LVDT-FL_LVDT_Ref)*100/(LVDT_Max-FL_LVDT_Ref); + }else{ + FL_LVDT=(FL_LVDT-FL_LVDT_Ref)*100/FL_LVDT_Ref; + }; + }else{ + FL_LVDT_Ref=FL_LVDT; + FL_LVDT=0; + lvdtref=lvdtref^(1<<3); }; - //pc.printf("Im in 1\n"); - }else{ - FL_LVDT_Ref=FL_LVDT; - FL_LVDT=0; - lvdtref=lvdtref^(1<<3); - //pc.printf("Ref=%d\n",FL_LVDT_Ref); }; - //pc.printf("FL_LVDT=%d, FL_LVDT0=%d\n",abs(FL_LVDT),abs(FL_LVDT0)); - //pc.printf("FR_LVDT=%d, FR_LVDT0=%d\n",abs(FR_LVDT),abs(FR_LVDT0)); - - if(!(lvdtref & (1<<2))){ - if (FR_LVDT>FR_LVDT_Ref){ + + if (newData[1]>0 && newData[1]<=1024){ + FR_LVDT0=FR_LVDT; + FR_LVDT=newData[1]; + if(!(lvdtref & (1<<2))){ + if (FR_LVDT>FR_LVDT_Ref){ FR_LVDT=(FR_LVDT-FR_LVDT_Ref)*100/(LVDT_Max-FR_LVDT_Ref); - }else{ - FR_LVDT=(FR_LVDT-FR_LVDT_Ref)*100/FR_LVDT_Ref; + }else{ + FR_LVDT=(FR_LVDT-FR_LVDT_Ref)*100/FR_LVDT_Ref; + }; + }else{ + FR_LVDT_Ref=FR_LVDT; + FR_LVDT=0; + lvdtref=lvdtref^(1<<2); }; - }else{ - FR_LVDT_Ref=FR_LVDT; - FR_LVDT=0; - lvdtref=lvdtref^(1<<2); }; - //printf("FL_Ref=%d, FR_Ref=%d, RL_Ref=%d, RR_Ref=%d\n",FL_LVDT_Dpos,FR_LVDT_Dpos,RL_LVDT_Dpos,RR_LVDT_Dpos); }; void UpdateInfoLVDTRear(uint16_t newData[4]){ //Update values for LVDTRear message - RL_LVDT0=RL_LVDT; - RL_LVDT=newData[0]; - RR_LVDT0=RR_LVDT; - RR_LVDT=newData[1]; - if(!(lvdtref & (1<<1))){ - if (RL_LVDT>RL_LVDT_Ref){ - RL_LVDT=(RL_LVDT-RL_LVDT_Ref)*100/(LVDT_Max-RL_LVDT_Ref); - }else{ - RL_LVDT=(RL_LVDT-RL_LVDT_Ref)*100/RL_LVDT_Ref; + if (newData[0]>0 && newData[0]<=1024){ + RL_LVDT0=RL_LVDT; + RL_LVDT=newData[0]; + if(!(lvdtref & (1<<1))){ + if (RL_LVDT>RL_LVDT_Ref){ + RL_LVDT=(RL_LVDT-RL_LVDT_Ref)*100/(LVDT_Max-RL_LVDT_Ref); + }else{ + RL_LVDT=(RL_LVDT-RL_LVDT_Ref)*100/RL_LVDT_Ref; + }; + }else{ + RL_LVDT_Ref=RL_LVDT; + RL_LVDT=0; + lvdtref=lvdtref^(1<<1); }; - }else{ - RL_LVDT_Ref=RL_LVDT; - RL_LVDT=0; - lvdtref=lvdtref^(1<<1); }; - - if(!(lvdtref & (1<<0))){ - if (RR_LVDT>RR_LVDT_Ref){ - RR_LVDT=(RR_LVDT-RR_LVDT_Ref)*100/(LVDT_Max-RR_LVDT_Ref); - }else{ - RR_LVDT=(RR_LVDT-RR_LVDT_Ref)*100/RR_LVDT_Ref; + + if (newData[1]>0 && newData[1]<=1024){ + RR_LVDT0=RR_LVDT; + RR_LVDT=newData[1]; + if(!(lvdtref & (1<<0))){ + if (RR_LVDT>RR_LVDT_Ref){ + RR_LVDT=(RR_LVDT-RR_LVDT_Ref)*100/(LVDT_Max-RR_LVDT_Ref); + }else{ + RR_LVDT=(RR_LVDT-RR_LVDT_Ref)*100/RR_LVDT_Ref; + }; + }else{ + RR_LVDT_Ref=RR_LVDT; + RR_LVDT=0; + lvdtref=lvdtref^(1<<0); }; - }else{ - RR_LVDT_Ref=RR_LVDT; - RR_LVDT=0; - lvdtref=lvdtref^(1<<0); }; - //pc.printf("RL_LVDT=%d, RL_LVDT0=%d\n",abs(RL_LVDT),abs(RL_LVDT0)); - //pc.printf("RR_LVDT=%d, RR_LVDT0=%d\n",abs(RR_LVDT),abs(RR_LVDT0)); - }; void UpdateInfoBrakes(uint16_t newData[4]){ //Update values for Brakes message - Brakes0=Brakes; - Brakes=newData[0]; + //if (newData[2]==0xFF || newData[2]==0x00){ + Brakes0=Brakes; + Brakes=newData[2]; + //pc.printf("%x\n",Brakes); + // }; }; \ No newline at end of file
--- a/CAN_library.h Thu Jul 05 20:18:32 2018 +0000 +++ b/CAN_library.h Sat Jul 07 14:42:17 2018 +0000 @@ -19,7 +19,6 @@ #define DISTANCE_MEMORY_ADDR 3592960 //Start address in SD card memory reserved for Distance Statistics. - //List of functions void CANMsgReceive(); // CAN RX Interrupt Function @@ -37,7 +36,7 @@ void UpdateInfoDTA4(uint16_t newData[4]); // Update values for DTA4 message void UpdateInfoDTA5(uint16_t newData[4]); // Update values for DTA5 message void UpdateInfoDTA6(uint16_t newData[4]); // Update values for DTA6 message -void UpdateMeterCounter(); +//void UpdateMeterCounter(); //U izradi void send(uint16_t ID, char dta[8]); void UpdateInfoLVDTFront(uint16_t newData[4]); // Update values for LVDTFront message void UpdateInfoLVDTRear(uint16_t newData[4]); // Update values for LVDTRear message
--- a/draw_print_library.cpp Thu Jul 05 20:18:32 2018 +0000 +++ b/draw_print_library.cpp Sat Jul 07 14:42:17 2018 +0000 @@ -414,8 +414,8 @@ }; -void BrakeSignal(int brake){ - if (brake){ +void BrakeSignal(uint16_t brake){ + if (brake!=0){ lcd.SetTextColor(LCD_COLOR_RED); lcd.SetBackColor(LCD_COLOR_RED); lcd.FillRect(560,340,230,68);
--- a/draw_print_library.h Thu Jul 05 20:18:32 2018 +0000 +++ b/draw_print_library.h Sat Jul 07 14:42:17 2018 +0000 @@ -28,7 +28,7 @@ const uint16_t LogoSmallXPos=635,LogoSmallYPos=5; //Small Logo, all three screens const uint16_t WaterTempXPos=15,WaterTempYPos=350; //Water Temperature in Main const uint16_t TPSXPos=569,TPSYPos=200; //TPS in Main -const uint16_t OilPXPos=330,OilPYPos=30; //Oil Pressure in First Auxiliary +const uint16_t RpmXPos=330,RpmYPos=30; //Oil Pressure in First Auxiliary const uint16_t MAPXPos=330,MAPYPos=90; //MAP in First Auxiliary const uint16_t AirTempXPos=330,AirTempYPos=150; //Air Temperature in First Auxiliary const uint16_t LambdaXPos=330,LambdaYPos=210; //Lambda Sensor value in First Auxiliary @@ -69,5 +69,5 @@ void UpdateSpeedMeter(int V,int dV); //Update Speedmeter function void ChangeCrank(int Crank); //Update Crank error message function int UpdateLVDTScale(int H,int H0, uint16_t StartXPos, uint16_t StartYPos); //Update LVDT Bar function -void BrakeSignal(int brake); //Set Brake signal function +void BrakeSignal(uint16_t brake); //Set Brake signal function void TestFont(); //Test font 50 function
--- a/main.cpp Thu Jul 05 20:18:32 2018 +0000 +++ b/main.cpp Sat Jul 07 14:42:17 2018 +0000 @@ -14,12 +14,12 @@ Timer t_int,t_store; // Variables received from DTA, LVDTs and brakes -uint16_t Rpm0=0,Speed0=0,Gear0=0,Water_Temp0=0,Oil_Temp0=0,TPS0=0,Brakes0=0,Oil_P0=0,MAP0=0,Air_Temp0=0,Lambda0=0,Volts0=0,Crank0=0; -uint16_t Rpm=0,Speed=0,Gear=0,Water_Temp=0,Oil_Temp=0,TPS=0,Brakes=0,Oil_P=0,MAP=0,Air_Temp=0,Lambda=0,Volts=0,Crank=0; +uint16_t Rpm0=0,Speed0=0,Gear0=0,Water_Temp0=0,Oil_Temp0=0,TPS0=0,Brakes0=0,MAP0=0,Air_Temp0=0,Lambda0=0,Volts0=0; +uint16_t Rpm=0,Speed=0,Gear=0,Water_Temp=0,Oil_Temp=0,TPS=0,Brakes=0,MAP=0,Air_Temp=0,Lambda=0,Volts=0; int FL_LVDT0=0,FR_LVDT0=0,RL_LVDT0=0,RR_LVDT0=0,FL_LVDT=0,FR_LVDT=0,RL_LVDT=0,RR_LVDT=0; //Referrent LVDT values. First received value is referrent. int FL_LVDT_Ref,FR_LVDT_Ref,RL_LVDT_Ref,RR_LVDT_Ref; -float Meter_counter=0,Meter_counter0=0; +//float Meter_counter=0,Meter_counter0=0; uint8_t change_flag=0; uint16_t rx_flag=0x0000; // Receive specific CAN data message @@ -49,13 +49,11 @@ void LEDInitialize(){ reset.write(1); - wait(1); // set port as output cmd[0]=0x06; cmd[1]=0x00; cmd[2]=0x00; i2c.write(addr,cmd,3); - pc.printf( "cao\n"); } void showLedRpm(int RPM){ @@ -77,7 +75,6 @@ cmd[2]=0xC7; } else if (RPM <5000) { - pc.printf("tu sam %d\n", RPM); cmd[1]=0xFF; cmd[2]=0xC3; }
--- 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