SHOULDER
Dependencies: X-NUCLEO-IHM05A1
Revision 33:48196cd5c052, committed 2019-09-13
- Comitter:
- stebonicelli
- Date:
- Fri Sep 13 15:26:06 2019 +0000
- Parent:
- 32:03c98e297a4a
- Child:
- 34:4be6353f0186
- Commit message:
- Led toggling
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Sep 13 09:26:41 2019 +0000
+++ b/main.cpp Fri Sep 13 15:26:06 2019 +0000
@@ -154,10 +154,6 @@
led=status;
printf("CAN send CURRENT POSITION Joint status %d : pose %f\t\n",status, pose);
}
-
-
-
-
}
void cantx_ISR()
{
@@ -174,9 +170,10 @@
if(can1.read(messageIn)&&messageIn.id==gen_can_id(JOINT_SET_SPEED,SHOULDER))
{
speed=messageIn.data[3] + (messageIn.data[2] << 8) + (messageIn.data[1] << 16) + (messageIn.data[0] << 24);
- printf("CAN: mess received : %d\n\r", speed);
+ printf("CAN: mess received : %f\n\r", speed);
current_speed=speed;
+ led = !led;
if (current_speed>0)
{
@@ -232,7 +229,6 @@
motor->attach_error_handler(&motor_error_handler);
-
end0.rise(&end0_int_handler);
end0.fall(&end0_int_handler_fall);
end1.rise(&end1_int_handler);
@@ -243,14 +239,11 @@
// CAN Initialization
// zero();
-
canrxa.start(canrx_ISR);
//cantxa.start(cantx_ISR);
printf("DONE: CAN Init\n\r");
-
-
printf("Running!\n\r");
//zero();
while(true)