v2019

Dependencies:   CRAC-Strat_2019 SerialHalfDuplex SDFileSystem DISCO-F469NI_portrait liaison_Bluetooth ident_crac

Dependents:   Codeprincipal_2019 CRAC-Strat_2019

Revision:
9:d0042422d95a
Parent:
6:eddfa414fd11
Child:
11:ed13a480ddca
diff -r 0edc7dfb7f7e -r d0042422d95a Asservissement/Asservissement.cpp
--- a/Asservissement/Asservissement.cpp	Wed Apr 27 13:05:03 2016 +0000
+++ b/Asservissement/Asservissement.cpp	Thu Apr 28 08:11:36 2016 +0000
@@ -134,3 +134,24 @@
 
     can1.write(msgTx);
 }
+
+void SetOdometrie (unsigned short canId, unsigned short x,unsigned short y,signed short theta)
+{
+    CANMessage msgTx=CANMessage();
+    msgTx.id=canId;
+    msgTx.format=CANStandard;
+    msgTx.type=CANData;
+    msgTx.len=6;
+
+        // x sur 2 octets
+    msgTx.data[0]=(unsigned char)x;
+    msgTx.data[1]=(unsigned char)(x>>8);
+    // y sur 2 octets
+    msgTx.data[2]=(unsigned char)y;
+    msgTx.data[3]=(unsigned char)(y>>8);
+    // theta signé sur 2 octets
+    msgTx.data[4]=(unsigned char)theta;
+    msgTx.data[5]=(unsigned char)(theta>>8);
+
+    can1.write(msgTx);
+}