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: C12832
main.cpp
00001 #include "mbed.h" 00002 #include "C12832.h" 00003 #include "moteur.h" 00004 #include "emissionIR.h" 00005 00006 /* Déclaration des objets glogaux ***************************/ 00007 00008 C12832 lcd(D11, D13, D12, D7, D10); 00009 00010 AnalogIn pot1(A0); 00011 AnalogIn pot2(A1); 00012 00013 DigitalOut LED_rouge(D5,1); 00014 DigitalOut LED_verte(D9,1); 00015 //DigitalOut LED_bleue(D8,1); // NE PAS UTILISER LA LED BLEUE 00016 00017 DigitalIn up(A2); 00018 DigitalIn down(A3); 00019 DigitalIn left(A4); 00020 DigitalIn right(A5); 00021 DigitalIn fire(D4); 00022 00023 00024 // Détecteurs d'obstacles 00025 AnalogIn IR_G(PB_1);AnalogIn IR_D(PC_2); 00026 00027 DigitalIn jack(PD_2); 00028 DigitalIn bumpers(PB_7); 00029 DigitalOut LED(PA_13); 00030 00031 // Détecteur de zone blanche 00032 BusIn Arrivee(PC_9,PC_10,PC_11,PC_12,PA_12,PA_14); 00033 00034 Serial uartWifi(SERIAL_TX, SERIAL_RX); 00035 //Serial uartWifi(PA_9, PA_10); 00036 00037 /* Déclaration des variables globales ****************************************/ 00038 00039 00040 /* Définition des fonctions gérant la machine à états ************************/ 00041 00042 // définition des fonctions 00043 void gestionEtat(){ 00044 } 00045 00046 void gestionAction(){ 00047 } 00048 00049 /******************************************************************************/ 00050 int main() { 00051 lcd.cls(); 00052 lcd.locate(32,16); 00053 lcd.printf("Module ER2 : template"); 00054 while(true){ 00055 wait(.5); 00056 switch(rand()%2){ 00057 case 0 : LED_rouge.write(!LED_rouge.read()); break; 00058 default : LED_verte.write(!LED_verte.read()); 00059 }//switch 00060 }//while 00061 } 00062 00063
Generated on Mon Jul 25 2022 03:47:51 by
