aa
Dependencies: mbed LCD_DISCO_F469NIa SD_DISCO_F469NI BSP_DISCO_F469NIa EEPROM_DISCO_F469NI
Diff: main.cpp
- Revision:
- 6:d6e001d7cf16
- Parent:
- 4:0e8413277df8
diff -r 4b63e6845a8e -r d6e001d7cf16 main.cpp --- a/main.cpp Wed Nov 28 12:01:20 2018 +0000 +++ b/main.cpp Wed Feb 12 18:49:12 2020 +0000 @@ -6,7 +6,7 @@ LCD_DISCO_F469NI lcd; //Initialize LCD Display SD_DISCO_F469NI sd; //Initialize SD Card //EEPROM_DISCO_F469NI eep; //Initialize EEPROM Internal memory -Serial pc(USBTX, USBRX); //Initialize Serial. This is used only while debuging code. +Serial pc(USBTX, USBRX,115200); //Initialize Serial. This is used only while debuging code. CAN can(PB_5, PB_13,1000000); //Initialize CAN. I2C i2c(D14, D15); DigitalOut reset(D8); @@ -14,12 +14,13 @@ 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,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; +uint16_t Capacity0=0,HV_Voltage0=0,Rpm0=0,Speed0=0,Gear0=0,Water_Temp0=0,Bat_Temp0=0,TPS0=0,Brakes0=0,MAP0=0,Air_Temp0=0,Lambda0=0,Volts0=0; +uint16_t Capacity=80,HV_Voltage=542,Rpm=0,Speed=720,Gear=0,Water_Temp=47,Bat_Temp=34,TPS=69,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; +uint8_t Acc_Temperature[70],Acc_Temperature0[70]; uint8_t change_flag=0; uint16_t rx_flag=0x0000; // Receive specific CAN data message @@ -57,7 +58,7 @@ } void showLedRpm(int RPM){ - pc.printf("%d\n",RPM); + //pc.printf("%d\n",RPM); if(RPM<1000) { cmd[1]=0xFF; cmd[2]=0xFF; @@ -120,18 +121,24 @@ int main(){ +//pc.printf("proba\n"); LEDInitialize(); can.attach(&CANMsgReceive,CAN::RxIrq); // Attach interrupt function to CAN RX change_screen_input.rise(&ChangeCommand); //Attach interrupt function to rising edge of DigitalIn for changing screen. - SetIntro(); // Display logo when starting display - SetMain(); // First screen is main by default + //SetIntro(); // Display logo when starting display + SetMain(); + lcd.SetTextColor(LCD_COLOR_BLACK); // First screen is main by default sd.Init(); - + for (uint8_t k = 1 ; k <= 70 ; k++){ + Acc_Temperature0[k] = 0; + }; + SetFixedAccTemp(); while(1){ if(change_flag){ // Check if screen is changed ChangeScreen(); }; UpdateInfo(); // Update info for DTA values in every iteration + //pc.printf("proba2\n"); switch(screen_flag){ // Display only changes visible on current screen case(1): MainUpdate();