|
|
| Ligne 70 : |
Ligne 70 : |
| | *Coller les autres petits éléments pour fabriquer les cales qui vont accueillir la tige filetée | | *Coller les autres petits éléments pour fabriquer les cales qui vont accueillir la tige filetée |
| | **BentoGhost14 : puis les percer | | **BentoGhost14 : puis les percer |
| − | **BentoGhost15 : ça ressemblera à ça | + | **BentoGhost15 : ça ressemblera à ça</translate> |
| − | *</translate>
| |
| | |Step_Picture_00=BentoGhost_BentoGhost09.jpg | | |Step_Picture_00=BentoGhost_BentoGhost09.jpg |
| | |Step_Picture_01=BentoGhost_BentoGhost10.jpg | | |Step_Picture_01=BentoGhost_BentoGhost10.jpg |
| Ligne 80 : |
Ligne 79 : |
| | }} | | }} |
| | {{Tuto Step | | {{Tuto Step |
| − | |Step_Title=<translate>Insérer le code</translate> | + | |Step_Title=<translate>Fabrication du plancher (suite 1)</translate> |
| − | |Step_Content=<translate><nowiki>#</nowiki>include <Servo.h> | + | |Step_Content=<translate>* BentoGhost16 : Vous avez alors plusieurs éléments : les 2 cales de côté, et les 3 portes-cible, dont les dimensions sont indiquées sur la photo |
| − | | + | * BentoGhost17 et BentoGhost18 : visser la pale qui va entraîner le remonte-cible en étant branchée sur le servomoteur |
| − | ////////////////// SERVOS ///////////////////////
| + | * BentoGhost19 : coller les 3 éléments du remonte-cible pour obtenir, sur les photos BentoGhost20 et 21, tous les éléments préconfigurés |
| − | | |
| − | Servo myservo1;
| |
| − | | |
| − | //int score_total = 0;
| |
| − | | |
| − | int pos90 = 97; // variable indiquant la position du servomoteur a 90
| |
| − | | |
| − | int pos0 = 0; // variable indiquant la position du servomoteur a 0
| |
| − | | |
| − | ///////////////POTAR START GAME/////////////
| |
| − | | |
| − | //const int potarStartGame = A6; // le potar qui active le jeu est sur la broche analogique A6
| |
| − | | |
| − | ////////////////// BUZZER///////////////////////
| |
| − | | |
| − | const int pinBuzzer = 13; //le buzzer est sur la broche 13
| |
| − | | |
| − | ///////////////// STAND de TIR//////////////////////
| |
| − | | |
| − | //ci-dessous le bouton et sa variable d etat ainsi que la led de la cible1
| |
| − | | |
| − | const int boutB1 = 4; //
| |
| − | | |
| − | int valBoutB1 = 0; //variable de l etat du bouton 1
| |
| − | | |
| − | const int ledB1 = 7; //
| |
| − | | |
| − | //ci-dessous le bouton et sa variable d etat ainsi que la led de la cible2
| |
| − | | |
| − | const int boutB2 = 5;
| |
| − | | |
| − | int valBoutB2 = 0; //variable de l etat du bouton 2
| |
| − | | |
| − | const int ledB2 = 8;
| |
| − | | |
| − | //ci-dessous le bouton et sa variable d etat ainsi que la led de la cible3
| |
| − | | |
| − | const int boutB3 = 6;
| |
| − | | |
| − | int valBoutB3 = 0; //variable de l etat du bouton 3
| |
| − | | |
| − | const int ledB3 = 9;
| |
| − | | |
| − | void setup()
| |
| − | | |
| − | {
| |
| − | | |
| − | Serial.begin(9600); //on etablie la connection avec le moniteur
| |
| − | | |
| − | //myservo1.attach(48); // le servomoteur myservo1 est relie a la broche 7
| |
| − | | |
| − | myservo1.attach(2); // le servomoteur myservo2 est relie a la broche 8
| |
| − | | |
| − | //myservo2.attach(52); // le servomoteur myservo3 est relie a la broche 9
| |
| − | | |
| − | // pinMode(potarStartGame, INPUT); // le potar est une entree
| |
| − | | |
| − | // pinMode(pinBuzzer, OUTPUT);// le buzzer est une sortie
| |
| − | | |
| − | //les led sont declarees en sortie
| |
| − | | |
| − | pinMode(ledB1, OUTPUT);
| |
| − | | |
| − | pinMode(ledB2, OUTPUT);
| |
| − | | |
| − | pinMode(ledB3, OUTPUT);
| |
| − | | |
| − | /*pinMode(ledB4, OUTPUT);
| |
| − | | |
| − | pinMode(ledB5, OUTPUT);
| |
| − | | |
| − | pinMode(ledB6, OUTPUT);
| |
| − | | |
| − | pinMode(ledB7, OUTPUT);
| |
| − | | |
| − | pinMode(ledB8, OUTPUT);
| |
| − | | |
| − | pinMode(ledB9, OUTPUT);
| |
| − | | |
| − | <nowiki>*</nowiki>/
| |
| − | | |
| − | //les boutons sont declares en entree
| |
| − | | |
| − | pinMode(boutB1, INPUT_PULLUP);
| |
| − | | |
| − | pinMode(boutB2, INPUT_PULLUP);
| |
| − | | |
| − | pinMode(boutB3, INPUT_PULLUP);
| |
| − | | |
| − | /* pinMode(boutB4, INPUT);
| |
| − | | |
| − | pinMode(boutB5, INPUT);
| |
| − | | |
| − | pinMode(boutB6, INPUT);
| |
| − | | |
| − | pinMode(boutB7, INPUT);
| |
| − | | |
| − | pinMode(boutB8, INPUT);
| |
| − | | |
| − | pinMode(boutB9, INPUT);
| |
| − | | |
| − | <nowiki>*</nowiki>/
| |
| − | | |
| − | // decompte avant partie
| |
| − | | |
| − | | |
| − | Serial.println("3");
| |
| − | | |
| − | tone(pinBuzzer, 300, 500);
| |
| − | | |
| − | delay(500);
| |
| − | | |
| − | Serial.println("2");
| |
| − | | |
| − | tone(pinBuzzer, 400, 500);
| |
| − | | |
| − | delay(500);
| |
| − | | |
| − | Serial.println("1");
| |
| − | | |
| − | tone(pinBuzzer, 500, 500);
| |
| − | | |
| − | delay(500);
| |
| − | | |
| − | tone(pinBuzzer, 600, 500);
| |
| − | | |
| − | delay(1000);
| |
| − | | |
| − | tone(pinBuzzer, 500, 500);
| |
| − | | |
| − | delay(500);
| |
| − | | |
| − | tone(pinBuzzer, 600, 500);
| |
| − | | |
| − | delay(500);
| |
| − | | |
| − | digitalWrite(ledB1, HIGH);
| |
| − | | |
| − | digitalWrite(ledB2, HIGH);
| |
| − | | |
| − | digitalWrite(ledB3, HIGH);
| |
| − | | |
| − | delay(1000);
| |
| − | | |
| − | myservo1.write(pos90);
| |
| − | | |
| − | Serial.println("pos90");
| |
| − | | |
| − | delay(2000);
| |
| − | | |
| − | myservo1.write(pos0);
| |
| − | | |
| − | Serial.println("pos0");
| |
| − | | |
| − | delay(1000);
| |
| − | | |
| − | | |
| − | }
| |
| − | | |
| − | void loop()
| |
| − | | |
| − | {
| |
| − | | |
| − | int valBoutB1 = digitalRead(boutB1);
| |
| − | | |
| − | digitalWrite(ledB1, !valBoutB1);
| |
| − | | |
| − | | |
| − | Serial.print("ledB1 : ");
| |
| − | | |
| − | Serial.println(ledB1);
| |
| − | | |
| − | Serial.print("valBoutB1 : ");
| |
| − | | |
| − | Serial.println(valBoutB1);
| |
| − | | |
| − | int valBoutB2 = digitalRead(boutB2);
| |
| − | | |
| − | digitalWrite(ledB2, !valBoutB2);
| |
| − | | |
| − | Serial.println("ledB2");
| |
| − | | |
| − | int valBoutB3 = digitalRead(boutB3);
| |
| − | | |
| − | digitalWrite(ledB3, !valBoutB3);
| |
| − | | |
| − | Serial.println("ledB3");
| |
| − | | |
| − | if (valBoutB1 == HIGH)
| |
| − | | |
| − | { if (valBoutB2 == HIGH)
| |
| − | | |
| − | { if (valBoutB3 == HIGH)
| |
| − | | |
| − | | |
| − | myservo1.write(pos90);
| |
| − | | |
| − | Serial.println("pos90");
| |
| − | | |
| − | delay(2000);
| |
| − | | |
| − | myservo1.write(pos0);
| |
| − | | |
| − | Serial.println("pos0");
| |
| − | | |
| − | delay(1000);
| |
| − | | |
| − | }
| |
| − | | |
| − | }
| |
| − | | |
| − | }
| |
| | | | |
| | <br /></translate> | | <br /></translate> |
| | + | |Step_Picture_00=BentoGhost_BentoGhost16.jpg |
| | + | |Step_Picture_01=BentoGhost_BentoGhost17.jpg |
| | + | |Step_Picture_02=BentoGhost_BentoGhost18.jpg |
| | + | |Step_Picture_03=BentoGhost_BentoGhost19.jpg |
| | + | |Step_Picture_04=BentoGhost_BentoGhost20.jpg |
| | + | |Step_Picture_05=BentoGhost_BentoGhost21.jpg |
| | + | }} |
| | + | {{Tuto Step |
| | + | |Step_Title=<translate>Fabrication du plancher (suite 2)</translate> |
| | + | |Step_Content=<translate></translate> |
| | }} | | }} |
| | {{Notes | | {{Notes |