Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of HelloWorld by
Revision 2:d0b2bfd92a6b, committed 2016-03-08
- Comitter:
- nnoitre
- Date:
- Tue Mar 08 13:30:07 2016 +0000
- Parent:
- 1:03c191369089
- Commit message:
- Building up the program
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 03c191369089 -r d0b2bfd92a6b main.cpp --- a/main.cpp Sun Jan 01 20:57:57 2012 +0000 +++ b/main.cpp Tue Mar 08 13:30:07 2016 +0000 @@ -1,12 +1,51 @@ #include "mbed.h" -DigitalOut myled(LED1); +DigitalOut myled1(LED1); +DigitalOut myled2(LED2); +DigitalOut myled3(LED3); +DigitalOut myled4(LED4); +DigitalIn down(p12); +DigitalIn left(p13); +DigitalIn up(p15); +DigitalIn right(p16); + +Serial xbee(p9,p10); int main() { + xbee.baud(57600); while(1) { - myled = 1; - wait(0.2); - myled = 0; - wait(0.2); + if(up&&!left&&!right){ + myled1 = 1; + xbee.putc(0); + } + if(up&&right){ + myled1=1; + myled2=1; + } + if(right&&!up&&!down){ + myled2 = 1; + } + if(down&&right){ + myled2=1; + myled3=1; + } + if(down&&!left&&!right){ + myled3 = 1; + } + if(down&&left){ + myled3=1; + myled4=1; + } + if(left&&!up&&!down){ + myled4 = 1; + } + if(up&&left){ + myled1=1; + myled4=1; + } + myled1=0; + myled2=0; + myled3=0; + myled4=0; } }
diff -r 03c191369089 -r d0b2bfd92a6b mbed.bld --- a/mbed.bld Sun Jan 01 20:57:57 2012 +0000 +++ b/mbed.bld Tue Mar 08 13:30:07 2016 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/078e4b97a13e +http://mbed.org/users/mbed_official/code/mbed/builds/87f2f5183dfb \ No newline at end of file