Luis Silvio Cordova Rivadeneira
/
CAN_ex_1
CAN_ex_1
Diff: main.cpp
- Revision:
- 2:d6cbcdb04ada
- Parent:
- 1:5791101761f9
- Child:
- 3:9d2d0b0189be
--- a/main.cpp Fri Jan 20 11:39:47 2017 -0600 +++ b/main.cpp Thu Oct 11 16:02:16 2018 +0000 @@ -1,8 +1,13 @@ #include "mbed.h" +#if defined (DEVICE_CAN) || defined(DOXYGEN_ONLY) + Ticker ticker; DigitalOut led1(LED1); DigitalOut led2(LED2); +/** The constructor takes in RX, and TX pin respectively. + * These pins, for this example, are defined in mbed_app.json + */ 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; @@ -30,3 +35,8 @@ wait(0.2); } } + +#else + #error CAN NOT SUPPORTED + +#endif