prog

Dependencies:   mbed mbed-rtos beep hcsr04

Files at this revision

API Documentation at this revision

Comitter:
altoimperatore
Date:
Wed Mar 27 11:52:41 2019 +0000
Parent:
2:33e2a092cab6
Commit message:
progetto 3

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- 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() {