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.
main.cpp
00001 #include "mbed.h" 00002 00003 Ticker ticker; 00004 DigitalOut led1(LED1); 00005 DigitalOut led2(LED2); 00006 DigitalOut led3(LED3); 00007 CAN can1(p30, p29); 00008 char counter = 0; 00009 00010 void send() { 00011 if(can1.write(CANMessage(1337, &counter, 1))) { 00012 led2 = !led2; 00013 } 00014 00015 led1 = !led1; 00016 } 00017 00018 int main() { 00019 ticker.attach(&send, 1); 00020 CANMessage msg; 00021 can1.frequency(250000); 00022 00023 int i = 0; 00024 00025 while(1) { 00026 if(can1.read(msg)) { 00027 counter++; 00028 led3 = !led3; 00029 } 00030 00031 wait(0.2); 00032 } 00033 }
Generated on Mon Jul 18 2022 00:13:54 by
1.7.2