William Hurst / Mbed 2 deprecated Nucleo_blink_led

Dependencies:   mbed

Committer:
wjhurst
Date:
Wed Apr 11 22:15:09 2018 +0000
Revision:
0:5c0fb059840c
sdf

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wjhurst 0:5c0fb059840c 1 #include "mbed.h"
wjhurst 0:5c0fb059840c 2
wjhurst 0:5c0fb059840c 3 DigitalOut myled(LED1);
wjhurst 0:5c0fb059840c 4
wjhurst 0:5c0fb059840c 5 CAN can1(p21, p22);
wjhurst 0:5c0fb059840c 6
wjhurst 0:5c0fb059840c 7 int main() {
wjhurst 0:5c0fb059840c 8 char counter = 1;
wjhurst 0:5c0fb059840c 9 while(1) {
wjhurst 0:5c0fb059840c 10 can1.write(CANMessage(1337, &counter, 1));
wjhurst 0:5c0fb059840c 11 myled = 1; // LED is ON
wjhurst 0:5c0fb059840c 12 wait(0.2); // 200 ms
wjhurst 0:5c0fb059840c 13 myled = 0; // LED is OFF
wjhurst 0:5c0fb059840c 14 wait(1.0); // 1 sec
wjhurst 0:5c0fb059840c 15 }
wjhurst 0:5c0fb059840c 16 }