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 //CAN can1(p9, p10); 00007 CAN can2(p9, p10); 00008 char counter = 0; 00009 00010 void send() { 00011 printf("send()\n"); 00012 if(can2.write(CANMessage(1337, &counter, 1))) { 00013 printf("wloop()\n"); 00014 counter++; 00015 printf("Message sent: %d\n", counter); 00016 } 00017 led1 = !led1; 00018 } 00019 00020 int main() { 00021 printf("main()\n"); 00022 ticker.attach(&send, 1); 00023 /*CANMessage msg; 00024 while(1) { 00025 printf("loop()\n"); 00026 if(can2.read(msg)) { 00027 printf("Message received: %d\n", msg.data[0]); 00028 led2 = !led2; 00029 } 00030 wait(0.2); 00031 }*/ 00032 wait(0.2); 00033 }
Generated on Tue Jul 12 2022 19:05:56 by
