Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 0:bcd95253c3d1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Jul 30 14:36:06 2019 +0000 @@ -0,0 +1,27 @@ +#include "mbed.h" + + +CAN can1(PB_8, PB_9, 500000); + +const char msg1_data[] = {0x38, 0x30, 0xAD, 0x29, 0x90, 0x1E, 0x6A, 0x00}; + +CANMessage msg1(0x40, (const char *)&msg1_data, 8, CANData, CANStandard); + +Ticker ticker; + +void send() +{ + can1.write(msg1); +} + +int main() +{ + // Send a message every second + ticker.attach(&send, 1); + + // Wait forever + while(1) + { + wait(1); + } +} \ No newline at end of file