Raciel Flores Benítez
/
Liditek_XBee_Maestro
Maestro
Revision 0:a68449ee4734, committed 2017-03-03
- Comitter:
- Sumobot
- Date:
- Fri Mar 03 06:21:42 2017 +0000
- Commit message:
- Mestro
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 a68449ee4734 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Mar 03 06:21:42 2017 +0000 @@ -0,0 +1,33 @@ +#include "mbed.h" +Serial xbee(p9,p10); +DigitalOut myled(LED1); +DigitalOut myled2(LED2); +Serial pc(USBTX, USBRX); +DigitalIn a(p12); +DigitalIn b(p13); +int dis, sub; +//DigitalIn c(p23); +//DigitalIn d(p24); + +int main() { + pc.baud(9600); + while(1) { + if(a==1) + { + dis = 0; + sub = 0; + xbee.printf("E.A,%D:%D\n", sub, dis); + myled = !myled; + wait(1); + } + if(b==1) + { + sub = 1; + dis = 1; + xbee.printf("E.A,%D:%D\n", sub, dis); + myled2 = !myled2; + wait(1); + } + } + } +
diff -r 000000000000 -r a68449ee4734 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Mar 03 06:21:42 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/176b8275d35d \ No newline at end of file