Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /********************************************************************
- Author : Brose Christophe
- Date : 19/03/2013
- File : MAIN.C
- Hardware : ADUC832
- Description : Brique de base pour Boe-Bot
- ********************************************************************/
- #define MAIN // Ne pas modifier
- #include "RobotLib.h" // Librairie de base
- #include <string.h>
- void main()
- {
- int i;
- char antenneGauche[] = "Detection antenne gauche";
- char antenneDroite[] = "Detection antenne droite";
- char frontal[] = "Detection frontale";
- char noObstacle[] = "Pas d'obstacle";
- InitRobot();
- // Initialisation de la RAM étendue, de la fréquence du µc, de l'UART et des ports en entrées
- while(1)
- {
- for(i=0;i<strlen(noObstacle);i++)
- {
- SerSend(noObstacle[i]);
- }
- while(P8 && P9);
- if(!P8) //collision antenne gauche
- {
- if(!P9)
- {
- for(i=0;i<strlen(frontal);i++)
- {
- SerSend(frontal[i]);
- }
- }
- else
- {
- for(i=0;i<strlen(antenneGauche);i++)
- {
- SerSend(antenneGauche[i]);
- }
- }
- }
- else
- {
- if(!P9)
- {
- //Envoie message collision antenne droite
- for(i=0;i<strlen(antenneDroite);i++)
- {
- SerSend(antenneDroite[i]);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement