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:
- 21:39815fb7e4f5
- Parent:
- 20:fa411d58e3ee
- Child:
- 22:64fa6f501426
--- a/main.cpp Sun May 03 06:36:00 2020 +0000
+++ b/main.cpp Sun May 03 11:37:39 2020 +0000
@@ -49,17 +49,17 @@
/******************************************************************************/
enum Machine_A_Etat
{
- Depart,Navigation,Arrivee,Evitement,Rotation
+ Depart,Navigation,Arrive,Evitement,Rotation
};
int main() {
int iState=Depart;
- int distObsGauche=pot1.write();
- int distObsDroite=pot2.write();
- int bumpers=bumpers.write();
- int up=up.write();
- int jack=jack.write();
- int fire=fire.write();
+ int distObsGauche=pot1.read();
+ int distObsDroite=pot2.read();
+ int bumpers=bumpers.read();
+ int up=up.read();
+ int jack=jack.read();
+ int fire=fire.read();
lcd.cls();
lcd.locate(32,16);
lcd.printf("Module ER2 : template");
@@ -75,7 +75,7 @@
commandeMoteurs(50,50);
//printf.lcd("Navigation");
break;
- case Arrivee :
+ case Arrive :
LED_verte.write(!LED_verte.read());
commandeMoteurs(0,0);
//printf.lcd("Arrive");
@@ -105,7 +105,7 @@
if(jack==0||fire==1)
iState=Navigation;
if(up==1)
- iState=Arrivee;
+ iState=Arrive;
}
while(iState=Navigation)
@@ -115,7 +115,7 @@
if(//20cm<distObsGauche<40cm&&20cm<distObsDroite<0cm)
iState=Evitation;
if(/*white tested*/||bumpers==1)
- iState=Arrivee;
+ iState=Arrive;
}
while(iState=Arrivee)
@@ -131,7 +131,7 @@
if(//distObsGauche>40cm&&distObsDroite>40cm)
iState=Navigation;
if(/*white tested*/||bumpers==1)
- iState=Arrivee;
+ iState=Arrive;
}
while(iState=Rotation)