affichage v7
Fork of AFFICHAGE by
Affichage.cpp
- Committer:
- fab16
- Date:
- 2017-03-23
- Revision:
- 9:2cc0e874fb4e
- Parent:
- 8:80a4449820ac
File content as of revision 9:2cc0e874fb4e:
#include "Affichage.h" m3pi m3piA; void Affichage::bonjour(){ m3piA.cls(); m3piA.print("Bonjour",7); wait(1); } void Affichage::afficheResult(float result){ m3piA.cls(); m3piA.printf("%f",result); wait(1); } // affichage de 8 caractere max void Affichage::affichageCourt(char*message){ m3piA.cls(); m3piA.print(message,strlen(message)); wait(1); } void Affichage::effacerTout(){ m3piA.cls(); } // teste affichage sur 2 ligne void Affichage::affichage2ligne(){ m3piA.cls(); m3piA.locate(0,0); m3piA.print("a",1); m3piA.locate(0,1); m3piA.print("b",1); } void Affichage::affichageUltrason(float distance){ m3piA.cls(); if(distance >= 250){ 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); } } void Affichage::afficherObstacle(bool obstacle){ m3piA.cls(); if(obstacle==true){ m3piA.printf("true"); wait(1); } else{ m3piA.printf("false"); wait(1); } } void Affichage::sePresenter(){ m3piA.locate(0,0); m3piA.printf("Je suis"); m3piA.locate(1,1); m3piA.printf("Metabee"); }