CAN for KL64F. No implementation for CAN class Find DEVICE_CAN macro in files to diagnose problems

Dependencies:   mbed-dev

Files at this revision

API Documentation at this revision

Comitter:
marcus255
Date:
Wed Nov 09 20:10:33 2016 +0000
Commit message:
KL64F CAN project. Initial version. Find DEVICE_CAN macro in mbed-dev sources

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-dev.lib Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 5d2bea7f2b45 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Nov 09 20:10:33 2016 +0000
@@ -0,0 +1,38 @@
+#include "mbed.h"
+
+void sw_2_pushed();
+void send();
+
+DigitalOut led_G(LED_GREEN);
+DigitalOut led_B(LED_BLUE);
+Serial pc(USBTX, USBRX);
+InterruptIn sw2(SW2);
+InterruptIn sw3(SW3);
+CAN can(PTB19, PTB18);
+int counter;
+
+void sw_2_pushed(){
+    pc.printf("SW1 PUSHED\r\n");
+//    send();
+    }
+
+/*void send() {
+    pc.printf("send()\n");
+    if(can.write(CANMessage(1337, &counter, 1))) {
+        pc.printf("wloop()\n");
+        counter++;
+        pc.printf("Message sent: %d\n", counter);
+    } 
+    led_G = !led_G;
+}*/
+
+int main()
+{
+    sw2.rise(&sw_2_pushed);
+    pc.printf("Hello World!\n");
+
+    while (true) {
+        wait(0.5f);                 // wait a small period of time
+        led_B = !led_B;             // toggle a led
+    }
+}
diff -r 000000000000 -r 5d2bea7f2b45 mbed-dev.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-dev.lib	Wed Nov 09 20:10:33 2016 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/marcus255/code/mbed-dev/#47af6dcc31de