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 Serial serial(PA_9,PA_10); 00003 DigitalOut myled(PB_3); 00004 CAN can(PA_11,PA_12); 00005 char counter = 0; 00006 CANMessage msg; 00007 void callback(){ 00008 if(can.read(msg)){ 00009 serial.printf("Message received: ID:%d,data0:%d,data1:%d\n",msg.id,msg.data[0],msg.data[1]); 00010 } 00011 } 00012 int main() { 00013 can.attach(&callback, CAN::RxIrq); 00014 while(1) 00015 { 00016 serial.printf("loop()\n"); 00017 wait(0.5); 00018 } 00019 }
Generated on Mon Jul 25 2022 19:21:30 by
1.7.2