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.
Diff: main.cpp
- Revision:
- 17:db154d50ab1f
- Child:
- 18:da2e22a3b09a
diff -r 7de323fa46fe -r db154d50ab1f main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sat May 02 12:41:42 2020 +0000
@@ -0,0 +1,61 @@
+ #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(){
+ }
+
+/******************************************************************************/
+int main() {
+ lcd.cls();
+ lcd.locate(32,16);
+ lcd.printf("Module ER2 : template");
+ while(true){
+ wait(.5);
+ switch(rand()%2){
+ case 0 : LED_rouge.write(!LED_rouge.read()); break;
+ default : LED_verte.write(!LED_verte.read());
+ }//switch
+ }//while
+ }
\ No newline at end of file