sdf

Fork of IntegrationCANajnovije by Nenad Djalovic

Files at this revision

API Documentation at this revision

Comitter:
nemanja1994
Date:
Sun Jun 24 15:50:52 2018 +0000
Parent:
5:53d7dbb8503c
Commit message:
Novo;

Changed in this revision

CAN_library.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 53d7dbb8503c -r f646d685b613 CAN_library.cpp
--- a/CAN_library.cpp	Wed Jun 20 21:27:51 2018 +0000
+++ b/CAN_library.cpp	Sun Jun 24 15:50:52 2018 +0000
@@ -6,8 +6,8 @@
 extern uint16_t rx_flag;
 extern uint8_t lvdtref;
 extern Serial tRF;
-extern uint16_t Rpm0, Speed0, Gear0, Water_Temp0, Oil_Temp0, TPS0, Brakes0, Oil_P0, MAP0, Air_Temp0, Lambda0, Volts0, Crank0,   BF_Oil_P0,   BR_Oil_P0;
-extern uint16_t Rpm,  Speed,  Gear,  Water_Temp,  Oil_Temp,  TPS,  Brakes,  Oil_P,  MAP,  Air_Temp,  Lambda,  Volts,  Crank,    BF_Oil_P,   BR_Oil_P;
+extern uint16_t Steer0, Rpm0, Speed0, Gear0, Water_Temp0, Oil_Temp0, TPS0, Brakes0, Oil_P0, MAP0, Air_Temp0, Lambda0, Volts0, Crank0,   BF_Oil_P0,   BR_Oil_P0;
+extern uint16_t Steer, Rpm,  Speed,  Gear,  Water_Temp,  Oil_Temp,  TPS,  Brakes,  Oil_P,  MAP,  Air_Temp,  Lambda,  Volts,  Crank,    BF_Oil_P,   BR_Oil_P;
 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=1024;
@@ -75,7 +75,7 @@
 };
 
 void UpdateInfo(){                          // Update info for DTA values
-    pc.printf("Im in UpdateInfo\n");
+    //pc.printf("Im in UpdateInfo\n");
     int noID=9;
     uint16_t *newData;
     for (int i=0;i<noID;i++){               //For loop goes trough Message IDs
@@ -153,7 +153,7 @@
     Water_Temp=newData[2];
     Air_Temp0=Air_Temp;
     Air_Temp=newData[3];
-    pc.printf("id=2000, Rpm= %d, TPS= %d, Water_temp= %d, Air_Temp= %d\n",Rpm,TPS,Water_Temp,Air_Temp);
+    //pc.printf("id=2000, Rpm= %d, TPS= %d, Water_temp= %d, Air_Temp= %d\n",Rpm,TPS,Water_Temp,Air_Temp);
 };
 
 void UpdateInfoDTA2(uint16_t newData[4]){                //Update values for DTA2 message
@@ -165,7 +165,7 @@
     Speed=newData[2];
     Oil_P0=Oil_P;
     Oil_P=newData[3];
-    pc.printf("id=2001, MAP= %d, Lambda= %d, Speed= %d, Oil_P= %d\n",MAP,Lambda,Speed,Oil_P);
+    //pc.printf("id=2001, MAP= %d, Lambda= %d, Speed= %d, Oil_P= %d\n",MAP,Lambda,Speed,Oil_P);
     //pc.printf("MAP=%d, Lambda=%d, Speed=%d, Oil_P=%d\n",MAP,Lambda,Speed,Oil_P);
 };
 
@@ -174,13 +174,13 @@
     Oil_Temp=newData[1];
     Volts0=Volts;
     Volts=newData[2];
-    pc.printf("id=2002, Oil_Temp= %d, Volts= %d\n",Oil_Temp,Volts);
+    //pc.printf("id=2002, Oil_Temp= %d, Volts= %d\n",Oil_Temp,Volts);
 };
 
 void UpdateInfoDTA4(uint16_t newData[4]){                //Update values for DTA4 message
     Gear0=Gear;
     Gear=newData[0];
-    pc.printf("id=2003, Gear= %d\n",Gear);
+    //pc.printf("id=2003, Gear= %d\n",Gear);
 };
 
 void UpdateInfoDTA5(uint16_t newData[4]){                //Update values for DTA5 message
@@ -189,7 +189,7 @@
 void UpdateInfoDTA6(uint16_t newData[4]){                //Update values for DTA6 message
     Crank0=Crank;
     Crank=newData[2];
-    pc.printf("id=2005, Crank\n",Crank);
+   // pc.printf("id=2005, Crank\n",Crank);
 };
 
 void UpdateInfoLVDTFront(uint16_t newData[4]){           //Update values for LVDTFront message
@@ -197,7 +197,9 @@
     FL_LVDT=newData[0];
     FR_LVDT0=FR_LVDT;
     FR_LVDT=newData[1];
-    //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);
+    Steer0=Steer;
+    Steer=newData[2];
+    pc.printf("FL_LVDT=%d, FR_LVDT=%d, Steer=%d\n",FL_LVDT,FR_LVDT,Steer);
 };
 
 void UpdateInfoLVDTRear(uint16_t newData[4]){            //Update values for LVDTRear message
@@ -205,7 +207,7 @@
     RL_LVDT=newData[0];
     RR_LVDT0=RR_LVDT;
     RR_LVDT=newData[1];
-    pc.printf("RL_LVDT=%d, RL_LVDT0=%d\n",RL_LVDT,RR_LVDT0); 
+    //pc.printf("RL_LVDT=%d, RL_LVDT0=%d\n",RL_LVDT,RR_LVDT); 
     //pc.printf("RR_LVDT=%d, RR_LVDT0=%d\n",abs(RR_LVDT),abs(RR_LVDT0));    
     
 };
@@ -217,4 +219,5 @@
     BR_Oil_P=newData[1];
     Brakes0=Brakes;
     Brakes=newData[2];
+    //pc.printf("BROILPF=%d, BROILPR=%d\n, BRAKING=%d",BF_Oil_P,BR_Oil_P,Brakes);
 };
\ No newline at end of file