affichage v7

Fork of AFFICHAGE by Projet robot

Revision:
6:82586f775dc5
Parent:
5:6834f15a1e48
Child:
7:8cadfcb7809f
--- a/Affichage.cpp	Thu Feb 16 14:50:17 2017 +0000
+++ b/Affichage.cpp	Thu Feb 23 09:14:53 2017 +0000
@@ -8,8 +8,6 @@
         m3piA.cls();
         m3piA.print("Bonjour",7);
         wait(1);
-    
-    
     }
     
     void Affichage::afficheResult(float result){
@@ -40,4 +38,23 @@
         m3piA.locate(0,1);
         m3piA.print("b",1);
     }
+    
+    void Affichage::affichageUltrason(float distance){
+        m3piA.cls();
+        
+        if(distance <= 0){
+            m3piA.print("  Rien  ",8);
+            m3piA.locate(0,1);
+            m3piA.print(" en vue ",8);
+            wait(1);
+        }
+        
+        else{
+            m3piA.locate(0,0);
+            m3piA.printf("Obstacle");
+            m3piA.locate(0,1);
+            m3piA.printf(" %.1f cm",distance);
+            wait(1);
+        }
+    }
     
\ No newline at end of file