SHOULDER
Dependencies: X-NUCLEO-IHM05A1
Revision 23:3110010d98a0, committed 2019-04-06
- Comitter:
- gidiana
- Date:
- Sat Apr 06 14:51:15 2019 +0000
- Parent:
- 22:137d1ef8d22d
- Child:
- 24:37f139e067b2
- Commit message:
- fixx
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Apr 06 09:29:05 2019 +0000
+++ b/main.cpp Sat Apr 06 14:51:15 2019 +0000
@@ -78,23 +78,23 @@
}
// CAN
-CAN can1(PA_11, PA_12); // RX, TX
+CAN can1(PB_12, PB_13); // RX, TX
CANMessage messageIn;
CANMessage messageOut;
-int filter = can1.filter(0x020, 0x4FF, CANStandard);
+int filter = can1.filter(0x010, 0x4FF, CANStandard);
void canrx()
{
while(1)
{
- if(can1.read(messageIn, filter))
+ if(can1.read(messageIn,filter)&&messageIn.id==0x010)
{
pose=messageIn.data[0] + (messageIn.data[1] << 8) + (messageIn.data[2] << 16) + (messageIn.data[3] << 24);
printf("CAN: mess %d\n\r", pose);
- /*
+
if (pose == 1)
{
motor->run(StepperMotor::FWD);
@@ -115,9 +115,9 @@
current_pose= motor->get_position();
motor->go_to(current_pose);
}
- */
+
- motor->go_to(pose);
+ // motor->go_to(pose);
}
}
}