Strategie_13h30
Fork of CRAC-Strat_2017_homologation_gros_rob by
peripheriques/capteurs.cpp
- Committer:
- matthieuvignon
- Date:
- 2017-05-25
- Revision:
- 22:8dec8824a6f7
- Parent:
- 18:cc5fec34ed9c
File content as of revision 22:8dec8824a6f7:
#include "peripheriques.h" AnalogIn cptGauche(p20); AnalogIn cptDroit(p19); DigitalIn pressionGauche(p23); DigitalIn pressionDroit(p24); AnalogIn telemetre(p15); //DigitalIn jack(p25); bool dataCouleurGauche(void){ bool couleurOK = false; if(cptGauche.read() < 0.3){ couleurOK = true; } return couleurOK; } bool dataCouleurDroit(void){ bool couleurOK = false; if(cptDroit.read() < 0.3){ couleurOK = true; } return couleurOK; } unsigned short dataTelemetre(void){ float distance = telemetre.read()*3.3*1159.6-687.5+98; return (unsigned short)distance; } bool dataPressionGauche(void){ if(cptGauche.read())return true; else return false; } bool dataPressionDroit(void){ if(cptDroit.read())return true; else return false; }