Gabriel Velasco
/
mbed_blinky_seeed
Testing stuff
Revision 0:f95a24befabd, committed 2018-06-15
- Comitter:
- gvela024
- Date:
- Fri Jun 15 20:25:09 2018 +0000
- Commit message:
- test
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 f95a24befabd main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Jun 15 20:25:09 2018 +0000 @@ -0,0 +1,31 @@ +#include "mbed.h" + +DigitalOut myled(LED1); +DigitalOut led2(LED2); +DigitalOut led3(LED3); + +AnalogIn adc(P0_26); +Serial serial(P0_0, P0_1, 19200); + +int main() { + + + while(1) { + myled = 1; + wait(0.2); + myled = 0; + wait(0.2); + + serial.printf("%5d\n\r", adc.read_u16()); + if(adc.read_u16() > (0xFFFF / 2)) + { + led2 = 1; + led3 = 0; + } + else + { + led2 = 0; + led3 = 1; + } + } +}
diff -r 000000000000 -r f95a24befabd mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Jun 15 20:25:09 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/5aab5a7997ee \ No newline at end of file