TLMoto

Dependencies:   CANnucleo CANnucleo_Hello mbed

Fork of CANnucleo_Hello by Zoltan Hudak

Revision:
3:464b06c16d24
Parent:
2:49c9430860d1
Child:
4:ccf4ac2deac8
--- a/main.cpp	Thu Jul 23 13:11:08 2015 +0000
+++ b/main.cpp	Fri Jul 24 00:46:47 2015 +0000
@@ -21,7 +21,7 @@
 #include "mbed.h"
 #include "CAN.h"
 
-#define BOARD1    1     // please change to 0 when compiling for board #2
+#define BOARD1    1     // please comment out this line when compiling for board #2
 
 #if defined(BOARD1)
     #define RX_ID   0x100
@@ -32,6 +32,7 @@
 #endif
 
 DigitalOut      led(LED1);
+int             ledTarget;
 Timer           timer;
 CAN             can(PA_11, PA_12);  // rx, tx
 CANMessage      rxMsg;
@@ -94,7 +95,8 @@
             printf("\r\n");            
             if(rxMsg.id == RX_ID) {             // if ID matches
                 rxMsg >> counter;               // extract first data item
-                rxMsg >> led;                   // extract second data item (and set LED status)
+                rxMsg >> ledTarget;             // extract second data item
+                led = ledTarget;                // set LED
                 printf("counter = %d\r\n", counter);
                 timer.start();
             }