prog
Dependencies: mbed Servo mbed-rtos beep hcsr04 TextLCD
Diff: main.cpp
- Revision:
- 3:272fb57c7fcb
- Parent:
- 2:33e2a092cab6
- Child:
- 4:48754f3702d7
--- a/main.cpp Wed Mar 27 11:32:56 2019 +0000 +++ b/main.cpp Wed Mar 27 11:52:41 2019 +0000 @@ -7,8 +7,8 @@ Serial pc(USBTX, USBRX);//tx e rx /******************************/ //sensori ad ultrasuoni -HCSR04 sensor1(D15, D14); //istanza oggetti "sensori" -HCSR04 sensor2(D12, D13); +HCSR04 sensor1(D2, D4); //istanza oggetti "sensori" +HCSR04 sensor2(D7, D8); //HCSR04 sensor3(D11, D9); /******************************/ @@ -39,21 +39,23 @@ int main(){ pc.printf("prova"); - while(true) { + //while(true) { sensori(); // blue.printf("prova"); - //if (mybutton) { + //if (mybutton) { for (int i = 0; i < 2; i++) - pc.printf("%d", occupata[i]); - } + { + pc.printf("il parcheggio numero %d è libero", i + 1); + break; + //} } - +} //void thread sensori() {