Ceci est une ancienne révision du document !
DOS SANTOS Bérénice, BENZEGGOUTA Djihane, HELLY D'ANGELIN Valentine, KE Wenqi, KOUADOU Elane, LE FLOCH Alicia,
Contact :valentinedangelin@hotmail.fr
Nous avons pour projet de construire un robot qui sera apte à combattre d'autres robots. Pour se faire nous avons du réfléchir à la meilleure configuration de robot possible (taille,forme, poids, centre d'inertie, matériel, spécificités…) tout en respectant un budget de cinquante euros. La grande spécificité de notre robot, en comparaison avec les robots adversaires, est qu'il est rond. L'idée de lui donner une forme ronde vient du fait qu'on pense que les autres robots auront davantage de difficultés à pousser Mineemon hors de l'arène.
Nous avons utilisé:
Mineemon est constitué de:.
.
Ici il faut décrire la fabrication de votre projet de A à Z. Il est astucieux de diviser en un maximum de partie votre projet, cela permet d'avoir une vision globale du projet et de “sous terminer” votre projet, ce qui est stimulant.
mettre :
//img11.hostingpics.net/pics/327668PCRrelayfrizt.png
#include <Servo.h> #define trigPin 10 #define echoPin 9
int gauchesensorPin1 = 2;
int centresensorPin1 = 3;
int droitesensorPin1 = 4;
int gauchesensorPin2 = 5;
int centresensorPin2 = 6;
int droitesensorPin2 = 7;
Servo myservo1; Servo myservo2;
void setup () {
myservo1.attach (12); myservo2.attach (13); Serial.begin (9600);
pinMode (trigPin,OUTPUT); pinMode (echoPin,INPUT);
pinMode(gauchesensorPin1,INPUT);
pinMode(centresensorPin1,INPUT);
pinMode(droitesensorPin1,INPUT);
pinMode(gauchesensorPin2,INPUT);
pinMode(centresensorPin2,INPUT);
pinMode(droitesensorPin2,INPUT);
}
void loop () {
int duration,distance; digitalWrite (trigPin,HIGH); delayMicroseconds (1000); digitalWrite (trigPin,LOW); duration = pulseIn (echoPin,HIGH); distance = (duration/2)/29.1; Serial.print (distance); Serial.println ("cm");
byte gauche1,centre1,droite1,gauche2,centre2,droite2;
gauche1 = digitalRead (gauchesensorPin1); centre1 = digitalRead (centresensorPin1); droite1 = digitalRead (droitesensorPin1);
gauche2 = digitalRead (gauchesensorPin2); centre2 = digitalRead (centresensorPin2); droite2 = digitalRead (droitesensorPin2);
if ( gauche1== LOW ){
Serial.println ("noirgauche"); myservo1.writeMicroseconds (1500); myservo2.writeMicroseconds (2000);
}
if ( gauche2== LOW ){
Serial.println ("noirgauche"); myservo1.writeMicroseconds (1500); myservo2.writeMicroseconds (2000);
}
if ( droite1== LOW ){
Serial.println ("noirdroite"); myservo1.writeMicroseconds (1000); myservo2.writeMicroseconds (1520);
}
if ( droite2== LOW ){
Serial.println ("noirdroite"); myservo1.writeMicroseconds (1000); myservo2.writeMicroseconds (1520);
}
if ( gauche1== LOW && centre1== LOW && droite1== LOW ){
Serial.println ("noirtout1"); myservo1.writeMicroseconds (1000); myservo2.writeMicroseconds (2000);
}
if ( gauche2== LOW && centre2== LOW && droite2== LOW ){
Serial.println ("noirtout2"); myservo1.writeMicroseconds (2000); myservo2.writeMicroseconds (1000);
}
if ( gauche1== HIGH && centre1== HIGH && droite1== HIGH && gauche2== HIGH && centre2== HIGH && droite2== HIGH && distance < 10){
Serial.println ("blanctout"); myservo1.writeMicroseconds (2000); myservo2.writeMicroseconds (1000);
}
if ( gauche1== HIGH && centre1== HIGH && droite1== HIGH && gauche2== HIGH && centre2== HIGH && droite2== HIGH && distance > 10){ Serial.println ("blanctout"); myservo1.writeMicroseconds (2000); myservo2.writeMicroseconds (1500);
}
if ( gauche1== HIGH && centre1== HIGH && droite1== HIGH && gauche2== HIGH && centre2== HIGH && droite2== HIGH ){ Serial.println ("noirtout"); myservo1.writeMicroseconds (1530); myservo2.writeMicroseconds (1500);
}
if ( gauche1== LOW && centre1== LOW){
Serial.println ("noirgauchecentre1"); myservo1.writeMicroseconds (1500); myservo2.writeMicroseconds (2000);
}
if ( gauche2== LOW && centre2== LOW){
Serial.println ("noirgauchecentre2"); myservo1.writeMicroseconds (1500); myservo2.writeMicroseconds (2000);
}
if ( centre1== LOW && droite1== LOW){
Serial.println ("noircentredroite1"); myservo1.writeMicroseconds (1000); myservo2.writeMicroseconds (1500);
}
if ( centre2== LOW && droite2== LOW){
Serial.println ("noircentredroite2"); myservo1.writeMicroseconds (1000); myservo2.writeMicroseconds (1500);
}
if ( gauche1== LOW && droite1== LOW && distance > 10){
Serial.println ("noirgauchedroite1+"); myservo1.writeMicroseconds (1000); myservo2.writeMicroseconds (2000);
}
if ( gauche2== LOW && droite2== LOW && distance > 10){
Serial.println ("noirgauchedroite2+"); myservo1.writeMicroseconds (1000); myservo2.writeMicroseconds (2000);
}
if ( gauche1== LOW && droite1== LOW && distance < 10){
Serial.println ("noirgauchedroite1-"); myservo1.writeMicroseconds (1000); myservo2.writeMicroseconds (2000);
}
if ( gauche2== LOW && droite2== LOW && distance < 10){
Serial.println ("noirgauchedroite2-"); myservo1.writeMicroseconds (1000); myservo2.writeMicroseconds (2000);
}
if ( gauche1== LOW && gauche2== LOW){
Serial.println ("noirgauche1gauche2"); myservo1.writeMicroseconds (1500); myservo2.writeMicroseconds (2000);
}
if ( droite1== LOW && droite2== LOW){
Serial.println ("noirdroite1droite2"); myservo1.writeMicroseconds (1000); myservo2.writeMicroseconds (1500);
}
if ( gauche1== LOW && centre2== LOW){
Serial.println ("noirgauche2centre2"); myservo1.writeMicroseconds (1000); myservo2.writeMicroseconds (1500);
}
if ( gauche1== LOW && droite2== LOW){
Serial.println ("noirgauche1droite2"); myservo1.writeMicroseconds (1000); myservo2.writeMicroseconds (1500);
}
if ( centre1== LOW && gauche2== LOW){
Serial.println ("noircentre1gauche2"); myservo1.writeMicroseconds (1000); myservo2.writeMicroseconds (1500);
}
if ( centre1== LOW && droite2== LOW){
Serial.println ("noircentre1droite2"); myservo1.writeMicroseconds (1000); myservo2.writeMicroseconds (1500);
}
if ( gauche2== LOW && droite1== LOW){
Serial.println ("noirgauche2droite1"); myservo1.writeMicroseconds (1000); myservo2.writeMicroseconds (1500);
}
if ( centre2== LOW && droite1== LOW){
Serial.println ("noircentre2droite1"); myservo1.writeMicroseconds (1000); myservo2.writeMicroseconds (1500);
}
if ( gauche2== LOW && centre2== LOW && gauche1== LOW && centre1== LOW){
Serial.println ("noirg2c2g1c1"); myservo1.writeMicroseconds (1000); myservo2.writeMicroseconds (1500);
}
if ( centre2== LOW && droite2== LOW && centre1== LOW && droite1== LOW){
Serial.println ("noirc2d2c1d1"); myservo1.writeMicroseconds (1000); myservo2.writeMicroseconds (1500);
}
if ( gauche2== LOW && droite2== LOW && gauche1== LOW && droite1== LOW){
Serial.println ("noirg2d2g1d2"); myservo1.writeMicroseconds (1000); myservo2.writeMicroseconds (1500); }
}