mbed_example
/
CAN_ex_1
Additional CAN example
Diff: main.cpp
- Revision:
- 1:5791101761f9
- Parent:
- 0:06f428d689e4
- Child:
- 2:d6cbcdb04ada
diff -r 06f428d689e4 -r 5791101761f9 main.cpp --- a/main.cpp Thu Jan 19 14:21:14 2017 -0600 +++ b/main.cpp Fri Jan 20 11:39:47 2017 -0600 @@ -3,13 +3,13 @@ Ticker ticker; DigitalOut led1(LED1); DigitalOut led2(LED2); -CAN can1(p9, p10); -CAN can2(p30, p29); +CAN can1(MBED_CONF_APP_CAN1_RD, MBED_CONF_APP_CAN1_TD); +CAN can2(MBED_CONF_APP_CAN2_RD, MBED_CONF_APP_CAN2_TD); char counter = 0; void send() { printf("send()\n"); - if(can1.write(CANMessage(1337, &counter;, 1))) { + if(can1.write(CANMessage(1337, &counter, 1))) { printf("wloop()\n"); counter++; printf("Message sent: %d\n", counter); @@ -19,7 +19,7 @@ int main() { printf("main()\n"); - ticker.attach(&send;, 1); + ticker.attach(&send, 1); CANMessage msg; while(1) { printf("loop()\n");