vjezba5
Dependencies: mbed
main.cpp
- Committer:
- mvucina
- Date:
- 2015-05-08
- Revision:
- 0:878ef2de4ada
File content as of revision 0:878ef2de4ada:
#include "mbed.h" DigitalOut redled(p5); DigitalOut greenled(p6); DigitalIn sw1(p7); int n=0; bool b= false; int main() { while(1) { if (sw1!=b){ wait(0.1); if(sw1==1){ n++; } b = sw1; } if (n>=10){ redled = 1; } } }