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.
Dependencies: mbed
main.cpp
- Committer:
- imihalj
- Date:
- 2016-11-10
- Revision:
- 1:d5b594dc8056
- Parent:
- 0:c32036656bb4
- Child:
- 2:549ed5b0a8d0
File content as of revision 1:d5b594dc8056:
#include "mbed.h" DigitalOut redled(p5); DigitalOut greenled(p6); DigitalIn sw1(p7); int main() { sw1.mode(PullUp); // Pull up internal resistor while(1) { if (sw1==1) { greenled = 0; //green led is off redled = 1; // flash red led wait(0.2); redled = 0; wait(0.2); } else if (sw1==0) { redled = 0; //red led is off greenled = 1; // flash green led wait(0.2); greenled = 0; wait(0.2); } } }