*****
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:b34c8e79762b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Oct 09 15:10:23 2015 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" + +DigitalOut redled(PA_5); +DigitalOut greenled(PA_6); +DigitalIn switchinput(PB_7); + +int main() +{ while(1) { // while loop + if(switchinput==1) { // if loop + redled=1; + greenled=0; + wait(0.5); + redled=0; + wait(0.5); + } // end if loop + else { // else loop + greenled=1; + redled=0; + wait(0.5); + greenled=0; + wait(0.5); + } // end else loop + } // end while loop +} // end main \ No newline at end of file