v2019

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

Dependents:   Codeprincipal_2019 CRAC-Strat_2019

Revision:
5:dcd817534b57
Parent:
4:88431b537477
Child:
6:eddfa414fd11
diff -r 88431b537477 -r dcd817534b57 Asservissement/Asservissement.cpp
--- a/Asservissement/Asservissement.cpp	Sun Apr 17 14:03:03 2016 +0000
+++ b/Asservissement/Asservissement.cpp	Sat Apr 23 09:16:14 2016 +0000
@@ -14,6 +14,24 @@
 }
 
 /*********************************************************************************************/
+/* FUNCTION NAME: SendAck                                                                    */
+/* DESCRIPTION  : Envoyer un acknowledge                                                     */
+/*********************************************************************************************/
+void SendAck(unsigned short id, unsigned short from)
+{
+    CANMessage msgTx=CANMessage();
+    msgTx.id=id;
+    msgTx.len=2;
+    msgTx.format=CANStandard;
+    msgTx.type=CANData;
+    // from sur 2 octets
+    msgTx.data[0]=(unsigned char)from;
+    msgTx.data[1]=(unsigned char)(from>>8);
+
+    can1.write(msgTx);
+}
+
+/*********************************************************************************************/
 /* FUNCTION NAME: GoToPosition                                                               */
 /* DESCRIPTION  : Transmission CAN correspondant à un asservissement en position (x,y,theta) */
 /*********************************************************************************************/