jim kizos
/
Ezbc2_LPC1347_reading_digital_input_pin_lights_leds
Ezsbc2 LPC1347, digital input, used for reading the state of a pin
Revision 0:98254ba634ed, committed 2015-04-15
- Comitter:
- kizosgr
- Date:
- Wed Apr 15 19:04:51 2015 +0000
- Commit message:
- A digital input, used for reading the state of a pin; Ezsbc2 ARM 1347
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 98254ba634ed main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Apr 15 19:04:51 2015 +0000 @@ -0,0 +1,21 @@ + +// A digital input, used for reading the state of a pin + + +// Flash an LED while a DigitalIn is true + +#include "mbed.h" + +DigitalIn enable(p14); // P1_21 +DigitalOut led1(p27); // P1_15 +DigitalOut led2(p28); // P1_16 + +int main() { + while(1) { + if(enable) { + led1 = !led1; + led2 = !led2; + } + wait(0.25); + } +}
diff -r 000000000000 -r 98254ba634ed mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Apr 15 19:04:51 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/487b796308b0 \ No newline at end of file