A
Dependencies: mbed Servo KeypadLib TextLCD
Diff: main.cpp
- Revision:
- 2:74c155c71eb5
- Parent:
- 1:02c938489de7
- Child:
- 3:c64c5ac14d22
--- a/main.cpp Tue Dec 04 11:50:39 2018 +0000 +++ b/main.cpp Wed Dec 05 20:25:42 2018 +0000 @@ -9,13 +9,28 @@ void inserisci();*/ InterruptIn button(PC_13); char v[4]; +int cont2; int main() { /*lcd.setMode(TextLCD_I2C::DispOn); lcd.setCursor(TextLCD_I2C::CurOn_BlkOn);*/ inizializza(); + cont2=0; + do{ scrivi("Immetti codice:"); - inserimento(v,4); + inserimento(v,4,true); + if (confronto(v,4)==true){ + menu(); + } + else{ + scrivi("Codice errato"); + wait(0.8); + cont2++; + } + }while(cont2<3); + if (cont2==3){ + allarme(); + } } /*void scrivi(char parola[]){