Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of CRAC-Strat_2017_HOMOLOGATION_PETIT_ROBOT by
capteurs.cpp
00001 #include "peripheriques.h" 00002 00003 AnalogIn cptGauche(p20); 00004 AnalogIn cptDroit(p19); 00005 00006 DigitalIn pressionGauche(p23); 00007 DigitalIn pressionDroit(p24); 00008 00009 AnalogIn telemetre(p15); 00010 00011 //DigitalIn jack(p25); 00012 00013 00014 bool dataCouleurGauche(void){ 00015 bool couleurOK = false; 00016 if(cptGauche.read() < 0.3){ 00017 couleurOK = true; 00018 } 00019 return couleurOK; 00020 } 00021 00022 bool dataCouleurDroit(void){ 00023 bool couleurOK = false; 00024 if(cptDroit.read() < 0.3){ 00025 couleurOK = true; 00026 } 00027 return couleurOK; 00028 } 00029 00030 unsigned short dataTelemetre(void){ 00031 float distance = telemetre.read()*3.3*1159.6-687.5+98; 00032 return (unsigned short)distance; 00033 } 00034 00035 bool dataPressionGauche(void){ 00036 if(cptGauche.read())return true; 00037 else return false; 00038 } 00039 00040 bool dataPressionDroit(void){ 00041 if(cptDroit.read())return true; 00042 else return false; 00043 }
Generated on Wed Jul 13 2022 17:05:17 by
