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.
Dependencies: mbed
pwm.cpp
- Committer:
- Blasko
- Date:
- 2015-10-13
- Revision:
- 0:2263e23eb7e8
- Child:
- 1:0bb74fa30daa
File content as of revision 0:2263e23eb7e8:
#include "mbed.h" Ticker ticker; DigitalOut led1(LED1); DigitalOut led2(LED2); CAN can2(p30, p29); char counter = 0; int x=0; int y=0; void send() { } int main() { printf("main()\n"); ticker.attach(&send, 1); CANMessage msg; can2.frequency(1000000); while(1) { // printf("loop()\n"); if(can2.read(msg)) { x = msg.data[4]; y = msg.data[0]; printf("Message received: x %d %d %d %d %d %d %d %d %d %d\r\n",msg.data[0],msg.data[1],msg.data[2],msg.data[3],msg.data[4],msg.data[5],msg.data[6],msg.data[7], x , y); led2 = !led2; } wait(0.05); } }