test reed switch for bike cadence & speed

Dependencies:   mbed

Fork of Blinking Led by Icarus Sensors

Committer:
smigielski
Date:
Wed Nov 19 19:34:09 2014 +0000
Revision:
0:b729782a3ad7
Child:
2:c76222c6370a
Main file

Who changed what in which revision?

UserRevisionLine numberNew contents of line
smigielski 0:b729782a3ad7 1 #include "mbed.h"
smigielski 0:b729782a3ad7 2
smigielski 0:b729782a3ad7 3 DigitalOut myled1(p18);
smigielski 0:b729782a3ad7 4 DigitalOut myled2(p20);
smigielski 0:b729782a3ad7 5
smigielski 0:b729782a3ad7 6 int main() {
smigielski 0:b729782a3ad7 7 while(1) {
smigielski 0:b729782a3ad7 8 myled1 = 1; // LED is ON
smigielski 0:b729782a3ad7 9 wait(0.05); // 200 ms
smigielski 0:b729782a3ad7 10 myled1 = 0; // LED is OFF
smigielski 0:b729782a3ad7 11 wait(0.05); // 1 sec
smigielski 0:b729782a3ad7 12 myled2 = 1; // LED is ON
smigielski 0:b729782a3ad7 13 wait(0.05); // 200 ms
smigielski 0:b729782a3ad7 14 myled2 = 0; // LED is OFF
smigielski 0:b729782a3ad7 15 wait(0.05); // 1 sec
smigielski 0:b729782a3ad7 16 }
smigielski 0:b729782a3ad7 17 }