![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
.
Dependencies: RTC-DS1307 Servo mbed
Fork of Progetto_Tandem_Finale by
main.cpp
- Committer:
- Karrots3
- Date:
- 2016-04-18
- Revision:
- 0:5daff114eb4a
- Child:
- 1:0e967fe8862e
File content as of revision 0:5daff114eb4a:
#include "mbed.h" DigitalIn bottone(p23); DigitalOut ledR(p25); DigitalOut ledG(p24); DigitalOut ledB(p26); PwmOut piezo(p22); bool flag=0; int c=0; int main() { while(1) { if(bottone==1&& c>0 && c<=10000) { ledR=0; flag=0; c=0; piezo.period(1.0 / 200.0); piezo.write(0.5); wait(2); piezo.write(0); wait(0.05); } else if(bottone==1) { ledR=1; flag=1; } else if (c>10000) { piezo.period(1.0 / 600.0); piezo.write(0.5); wait(1.0 / 2); piezo.write(0); wait(0.05); } if(flag==1) { c++; } wait_ms(1); } }