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
Diff: pwm.cpp
- Revision:
- 0:2263e23eb7e8
- Child:
- 1:0bb74fa30daa
diff -r 000000000000 -r 2263e23eb7e8 pwm.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pwm.cpp Tue Oct 13 17:59:02 2015 +0000
@@ -0,0 +1,28 @@
+#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);
+ }
+}
\ No newline at end of file