v2019
Dependencies: CRAC-Strat_2019 SerialHalfDuplex SDFileSystem DISCO-F469NI_portrait liaison_Bluetooth ident_crac
Dependents: Codeprincipal_2019 CRAC-Strat_2019
Diff: Asservissement/Asservissement.cpp
- Revision:
- 29:41e02746041d
- Parent:
- 28:acd18776ed2d
- Child:
- 44:badcbe8766e9
diff -r acd18776ed2d -r 41e02746041d Asservissement/Asservissement.cpp --- a/Asservissement/Asservissement.cpp Sat May 27 05:40:26 2017 +0000 +++ b/Asservissement/Asservissement.cpp Fri Apr 06 13:47:19 2018 +0000 @@ -1,4 +1,4 @@ -#include "Asservissement.h" +#include "global.h" /*********************************************************************************************************/ /* FUNCTION NAME: SendRawId */ @@ -7,9 +7,10 @@ void SendRawId (unsigned short id) { CANMessage msgTx=CANMessage(); + led4=1; msgTx.id=id; msgTx.len=0; - can1.write(msgTx); + can2.write(msgTx); wait_us(200); } @@ -28,7 +29,7 @@ msgTx.data[0]=(unsigned char)from; msgTx.data[1]=(unsigned char)(from>>8); - can1.write(msgTx); + can2.write(msgTx); } /*********************************************************************************************/ @@ -55,7 +56,7 @@ msgTx.data[5]=(unsigned char)(theta>>8); msgTx.data[6]=sens; - can1.write(msgTx); + can2.write(msgTx); } /****************************************************************************************/ @@ -73,7 +74,7 @@ msgTx.data[0]=(unsigned char)angle; msgTx.data[1]=(unsigned char)(angle>>8); - can1.write(msgTx); + can2.write(msgTx); } @@ -107,7 +108,7 @@ //Enchainement sur 1 octet msgTx.data[5]=isEnchainement; - can1.write(msgTx); + can2.write(msgTx); //wait_ms(500); } @@ -133,7 +134,7 @@ // Enchainement sur 1 octet msgTx.data[5]=enchainement; - can1.write(msgTx); + can2.write(msgTx); } void SetOdometrie (unsigned short canId, unsigned short x,unsigned short y,signed short theta) @@ -154,7 +155,7 @@ msgTx.data[4]=(unsigned char)theta; msgTx.data[5]=(unsigned char)(theta>>8); - can1.write(msgTx); + can2.write(msgTx); } /****************************************************************************************/ @@ -171,7 +172,7 @@ // Angle signé sur 2 octets msgTx.data[0]=(unsigned char)((enable==0)?0:1); - can1.write(msgTx); + can2.write(msgTx); } @@ -191,7 +192,7 @@ msgTx.data[2]=(unsigned char)(acceleration&0x00FF); msgTx.data[3]=(unsigned char)((acceleration&0xFF00)>>8); - can1.write(msgTx); + can2.write(msgTx); } @@ -212,7 +213,7 @@ msgTx.data[2]=(unsigned char)(deceleration&0x00FF); msgTx.data[3]=(unsigned char)((deceleration&0xFF00)>>8); - can1.write(msgTx); + can2.write(msgTx); }