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.
Dependencies: mbed Herkulex_Library_2019 actions_Gr ident_crac actions_Pr
Capteurs/Capteur.cpp
- Committer:
- Artiom
- Date:
- 2019-05-31
- Revision:
- 46:85208ab1fa12
- Parent:
- 25:9627700d989f
File content as of revision 46:85208ab1fa12:
#include "Capteur.h"
///////////////////////////////////////Capteurs de Contact///////////////////////
DigitalIn capteur_contact_block(PB_15);
DigitalIn capteur_contact1(PB_4);
DigitalIn capteur_contact2(PB_5);
DigitalIn capteur_contact3(PH_1);
/////////////////////////////////////Lecture Batterie////////////////////////////
AnalogIn Val_batterie(PC_2);
///////////////////////////////////Capteurs multiCouleurs////////////////////////
/////////////////////////////////////Capteurs monocouleur////////////////////////
DigitalIn monocouleur1(PC_15);
DigitalIn monocouleur2(PC_14);
DigitalIn monocouleur3(PB_10);
DigitalIn monocouleur4(PC_3);
/////////////////////////////////////Capteurs industriels////////////////////////
/*AnalogIn Capteur_indus1(PA_7);
AnalogIn Capteur_indus2(PA_6);
AnalogIn Capteur_indus3(PA_5);
AnalogIn Capteur_indus4(PA_4);
AnalogIn Capteur_indus5(PC_1);
AnalogIn Capteur_indus6(PC_0);*/
short distance_moyenne;
short lecture_telemetre(char numero_telemetre) // DEGUEUX MAIS FONCTIONNEL :')
{
switch(numero_telemetre) {
case 1:
distance_moyenne=(short)DT1_trait_Ex;
break;
case 2:
distance_moyenne=(short)DT2_trait_Ex;
break;
case 3:
distance_moyenne=(short)DT3_trait_Ex;
break;
case 4:
distance_moyenne=(short)DT4_trait_Ex;
break;
}
return distance_moyenne;
}
int capteur_contact(void)
{
if(capteur_contact_block.read()==1) {
return 1;
} else {
return 0;
}
}