programme de lecture du volant

Dependencies:   LCD_DISCO_F746NG BSP_DISCO_F746NG

Files at this revision

API Documentation at this revision

Comitter:
ktaoudi
Date:
Fri Apr 16 08:52:09 2021 +0000
Parent:
0:3f67cbd56eee
Commit message:
test bus sature;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 3f67cbd56eee -r 5da69fd135da main.cpp
--- a/main.cpp	Wed Apr 14 07:27:31 2021 +0000
+++ b/main.cpp	Fri Apr 16 08:52:09 2021 +0000
@@ -15,10 +15,23 @@
     can.frequency(500000);
     int i = 0;
     bool bp1_old=1,bp1_new;
+    
+    char msgtosend[6];
+    msgtosend[0]=0xFF;  //régime moteur
+    msgtosend[1]=0xFF;  // 
+    msgtosend[2]=0xFF;  //vitesse
+    msgtosend[3]=0x00;  //
+    msgtosend[4]=0x00;
+    msgtosend[5]=0x00;
+    
     while (1) {
         bp1_new=bp1;
         if ((bp1_new==0) && (bp1_old == 1)) {
 
+           while(1)
+            can.write(CANMessage(0x001, msgtosend, 6));
+            
+            
             if(can.read(msg)) {
                 i++;
                 sprintf((char *)text1,"ID: %x", msg.id);