Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed LCD_DISCO_F469NIa SD_DISCO_F469NI BSP_DISCO_F469NIa EEPROM_DISCO_F469NI
Diff: main.cpp
- Revision:
- 2:f54f01527ebb
- Parent:
- 0:38c3afd99aeb
- Child:
- 3:a06e417a5a2c
--- a/main.cpp Wed May 16 14:55:13 2018 +0000
+++ b/main.cpp Thu Jun 28 16:33:23 2018 +0000
@@ -1,11 +1,15 @@
#include "CAN_library.h"
#include "screen_library.h"
+#include "EEPROM_DISCO_F469NI.h"
+
LCD_DISCO_F469NI lcd; //Initialize LCD Display
SD_DISCO_F469NI sd; //Initialize SD Card
-Serial pc(USBTX, USBRX); //Initialize Serial. This is used only while debuging code.
+//EEPROM_DISCO_F469NI eep; //Initialize EEPROM Internal memory
+Serial pc(USBTX, USBRX); //Initialize Serial. This is used only while debuging code.
CAN can(PB_5, PB_13); //Initialize CAN.
InterruptIn change_screen_input(D0); //Initialize Digital input for Change screen button
+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;
@@ -13,10 +17,12 @@
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 change_flag=0;
uint16_t rx_flag=0x0000; // Receive specific CAN data message
-uint8_t lvdtref=0x0F; // Flag if refferent LVDT value is received (first received LVDT value, 1=no, 0=yes). From highest to lowest bit: LL,LR,RL,RR.
+uint8_t distance_flag=0;
+uint8_t lvdtref=0x0F; // Flag if refferent LVDT value is received (first received LVDT value, 1=no, 0=yes). From highest to lowest bit: LL,LR,RL,RR.
uint8_t screen_flag=0x01; // Current screen flag. 1=Main, 2=First Aux, 3=Second Aux.
uint8_t ft_main_flag=1; // Detect first time Main screne in loop
uint8_t ft_2aux_flag=1; // Detect first time Second Aux screne in loop
@@ -32,6 +38,7 @@
CANMessage msgLVDTFront; // Left, Right, Steering Wheel
CANMessage msgLVDTRear; // Left, Right
CANMessage msgBrakes; // Brake system preassure, Braking On/Off
+CANMessage msgDistance; // Total distance
int main(){
@@ -39,6 +46,7 @@
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
+ //sd.Init();
while(1){
if(change_flag){ // Check if screen is changed
ChangeScreen();