Moway "obstacle"

1531 mots 7 pages
Problématique individuelle

Partie Electronique

Programme

But du programme : faire une ronde simple, si un obstacle est détecté, le robot doit s'arrêter

////////////////////////////////////////////////////////DEBUT

void main () { //Configuration des capteur et moteurs SEN_CONFIG(); MOT_CONFIG(); //LED verte et rouge allumée LED_TOP_GREEN_ON(); LED_TOP_RED_ON(); //Pause de 2 seconde PAUSE_SECONDE(2); //Définition du parcours C-A-D 1m while(MOT_DISTANCE_PARCOURUE()50) ||(SEN_OBS_ANALOG(OBS_SIDE_R)>50) ||(SEN_OBS_ANALOG(OBS_CENTER_L)>50) ||(SEN_OBS_ANALOG(OBS_CENTER_R)>50)) { LED_TOP_RED_ON(); LED_TOP_GREEN_OFF(); MOT_STOP(); } //Sinon la DEL verte est allumée et le robot avance d'un mètre else { LED_TOP_GREEN_ON(); LED_TOP_RED_OFF(); MOT_STR(100,FWD,DISTANCE,255); } } //Le robot tourne a 180 degré while(!MOT_END){}; MOT_RST(RST_KM); MOT_ROT(100,FWD,CENTER,RIGHT,ANGLE,50); while(!MOT_END){}; MOT_RST(RST_KM); //Définition du parcours C-A-D 1m while(MOT_DISTANCE_PARCOURUE()50) ||(SEN_OBS_ANALOG(OBS_SIDE_R)>50) ||(SEN_OBS_ANALOG(OBS_CENTER_L)>50) ||(SEN_OBS_ANALOG(OBS_CENTER_R)>50)) { LED_TOP_RED_ON(); LED_TOP_GREEN_OFF(); MOT_STOP(); } //Sinon la DEL verte est allumée et le robot avance d'un mètre else{ LED_TOP_GREEN_ON(); LED_TOP_RED_OFF(); MOT_STR(100,FWD,DISTANCE,255); } } //Le robot tourne a 180 degré et s'arrete while(!MOT_END){}; MOT_ROT(100,FWD,CENTER,RIGHT,ANGLE,50); while(!MOT_END){}; while(1) { MOT_STOP(); }

en relation

  • Questionnaire
    258 mots | 2 pages
  • Moway
    418 mots | 2 pages
  • Dossier PSE bac pro eleec
    1588 mots | 7 pages
  • Moway
    700 mots | 3 pages
  • Pré proj bts electech
    1217 mots | 5 pages
  • Moway
    503 mots | 3 pages
  • Expose sur la wii
    5373 mots | 22 pages
  • Rapport de stage bac pro eleec
    267 mots | 2 pages
  • Mochelin
    1327 mots | 6 pages
  • Acad Mie De Paris Cr Teil Versailles
    1995 mots | 8 pages
  • Moovijob
    255 mots | 2 pages
  • Mouley abdlaziz
    2050 mots | 9 pages
  • Dossier e2
    1854 mots | 8 pages
  • Moway
    260 mots | 2 pages
  • Mozzard
    264 mots | 2 pages