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.
main.cpp
- Committer:
- burgerking
- Date:
- 2020-05-02
- Revision:
- 19:c3d287239c9c
- Parent:
- 18:da2e22a3b09a
- Child:
- 20:fa411d58e3ee
File content as of revision 19:c3d287239c9c:
#include "mbed.h"
#include "C12832.h"
#include "moteur.h"
#include "emissionIR.h"
/* Déclaration des objets glogaux ***************************/
C12832 lcd(D11, D13, D12, D7, D10);
AnalogIn pot1(A0);
AnalogIn pot2(A1);
DigitalOut LED_rouge(D5,1);
DigitalOut LED_verte(D9,1);
//DigitalOut LED_bleue(D8,1); // NE PAS UTILISER LA LED BLEUE
DigitalIn up(A2);
DigitalIn down(A3);
DigitalIn left(A4);
DigitalIn right(A5);
DigitalIn fire(D4);
// Détecteurs d'obstacles
AnalogIn IR_G(PB_1);AnalogIn IR_D(PC_2);
DigitalIn jack(PD_2);
DigitalIn bumpers(PB_7);
DigitalOut LED(PA_13);
// Détecteur de zone blanche
BusIn Arrivee(PC_9,PC_10,PC_11,PC_12,PA_12,PA_14);
Serial uartWifi(SERIAL_TX, SERIAL_RX);
//Serial uartWifi(PA_9, PA_10);
/* Déclaration des variables globales ****************************************/
/* Définition des fonctions gérant la machine à états ************************/
// définition des fonctions
void gestionEtat(){
}
void gestionAction(){
}
/******************************************************************************/
enum Machine_A_Etat
{
Depart,Navigation,Arrivee,Evitement,Rotation
};
int main() {
int iState=Depart;
lcd.cls();
lcd.locate(32,16);
lcd.printf("Module ER2 : template");
while(true){
wait(.5);
switch(iState){
case Depart :
LED_verte.write(1);
break;
case Navigation :
case Arrivee :
case Evitement :
case Rotation :
}//switch
}//while
}