hbjhjb
Dependencies: mbed X-NUCLEO-IHM05A1
Revision 32:465e41868fe4, committed 2019-09-13
- Comitter:
- gidiana
- Date:
- Fri Sep 13 09:24:19 2019 +0000
- Parent:
- 31:5d6a97adae07
- Child:
- 33:c1cefad6d338
- Commit message:
- little endian
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Sep 05 20:16:02 2019 +0000
+++ b/main.cpp Fri Sep 13 09:24:19 2019 +0000
@@ -154,9 +154,9 @@
// printf("receive\t\n");
if(can1.read(messageIn)&&messageIn.id==gen_can_id(JOINT_SET_SPEED,BASE))
{
- speed=messageIn.data[0] + (messageIn.data[1] << 8) + (messageIn.data[2] << 16) + (messageIn.data[3] << 24);
+ speed=messageIn.data[3] + (messageIn.data[2] << 8) + (messageIn.data[1] << 16) + (messageIn.data[0] << 24);
printf("CAN: mess %d\n\r", speed);
- current_speed=speed-100;
+ current_speed=speed;
if (current_speed>0)
@@ -180,7 +180,7 @@
if(can1.read(messageIn)&&messageIn.id==gen_can_id(JOINT_ZERO,BASE))
{
- if((messageIn.data[0] + (messageIn.data[1] << 8) + (messageIn.data[2] << 16) + (messageIn.data[3] << 24))==1)
+ if((messageIn.data[3] + (messageIn.data[2] << 8) + (messageIn.data[1] << 16) + (messageIn.data[0] << 24))==1)
{
zero();
motor->wait_while_active();
@@ -222,7 +222,7 @@
canrxa.start(canrx_ISR);
- cantxa.start(cantx_ISR);
+ //cantxa.start(cantx_ISR);
printf("DONE: CAN Init\n\r");
@@ -230,7 +230,7 @@
printf("Running!\n\r");
- zero();
+ //zero();
while(true)
{