Alyson Castiblanco
/
PRUEBASERIAL1
Código de prueba de leds desde Matlab. Pendiente ADC y datos desde tarjeta a Matlab
Revision 0:ff26bbb6038a, committed 2018-10-26
- Comitter:
- acastiblancoc
- Date:
- Fri Oct 26 22:15:36 2018 +0000
- Commit message:
- Codigo de prueba
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 ff26bbb6038a main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Oct 26 22:15:36 2018 +0000 @@ -0,0 +1,29 @@ +#include "mbed.h" + +Serial pc(SERIAL_TX, SERIAL_RX); +DigitalOut led(D2); +DigitalOut led1(D3); +DigitalOut led2(D4); +AnalogIn pot(A0); +int main() +{ + pc.printf("Press '1' to turn LED1 ON, '0' to turn it OFF\n"); + + while(1) { + char c = pc.getc(); // Read hyperterminal + if (c == '0') { + led = 1; + led1=0; + led2=0; + } + if (c == '2') { + led = 0; + led1=1; + led2=0; + } + led2.write(c); + float T=pot.read(); + + } +} +
diff -r 000000000000 -r ff26bbb6038a mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Oct 26 22:15:36 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/a7c7b631e539 \ No newline at end of file