ENIB 2023 : Les 7 erreurs : Différence entre versions
(→Catégories) |
|||
(3 révisions intermédiaires par un autre utilisateur non affichées) | |||
Ligne 42 : | Ligne 42 : | ||
==Code== | ==Code== | ||
<pre> | <pre> | ||
− | + | /* | |
+ | |||
+ | |||
+ | D1 mini | ||
+ | BROCHAGE | ||
+ | _________________ | ||
+ | / D1 mini \ | ||
+ | |[ ]RST TX[ ]| | ||
+ | |[ ]A0 -GPIO RX[ ]| | ||
+ | |[ ]D0-16 5-D1[ ]| SCL | ||
+ | |[ ]D5-14 4-D2[ ]| SDA | ||
+ | |[ ]D6-12 0-D3[ ]| | ||
+ | |[ ]D7-13 2-D4[ ]| LED_BUILTIN | ||
+ | |[ ]D8-15 GND[ ]| | ||
+ | |[ ]3V3 . 5V[ ]| | ||
+ | | +---+ | | ||
+ | |_______|USB|_______| | ||
+ | |||
+ | _______________ | ||
+ | |||
+ | 2 fois jaune | ||
+ | |||
+ | */ | ||
+ | |||
+ | |||
+ | |||
+ | int green=0; | ||
+ | int yellow=4; | ||
+ | int orange=2; | ||
+ | |||
+ | |||
+ | |||
+ | void setup() { | ||
+ | Serial.begin(9600); | ||
+ | |||
+ | pinMode(green, OUTPUT); | ||
+ | pinMode(yellow, OUTPUT); | ||
+ | pinMode(orange, OUTPUT); | ||
+ | |||
+ | |||
+ | } | ||
+ | |||
+ | void loop() { | ||
+ | //code qui allume les leds dans l'ordre des cartes | ||
+ | digitalWrite(yellow, HIGH); | ||
+ | delay(500); | ||
+ | digitalWrite(yellow, LOW); | ||
+ | delay(500); | ||
+ | digitalWrite(yellow, HIGH); | ||
+ | delay(500); | ||
+ | digitalWrite(yellow, LOW); | ||
+ | delay(2000); | ||
+ | |||
+ | digitalWrite(orange, HIGH); | ||
+ | delay(500); | ||
+ | digitalWrite(orange, LOW); | ||
+ | delay(2000); | ||
+ | |||
+ | digitalWrite(yellow, HIGH); | ||
+ | delay(500); | ||
+ | digitalWrite(yellow, LOW); | ||
+ | delay(500); | ||
+ | digitalWrite(yellow, HIGH); | ||
+ | delay(500); | ||
+ | digitalWrite(yellow, LOW); | ||
+ | delay(500); | ||
+ | digitalWrite(yellow, HIGH); | ||
+ | delay(500); | ||
+ | digitalWrite(yellow, LOW); | ||
+ | delay(2000); | ||
+ | |||
+ | digitalWrite(green, HIGH); | ||
+ | delay(500); | ||
+ | digitalWrite(green, LOW); | ||
+ | delay(500); | ||
+ | digitalWrite(green, HIGH); | ||
+ | delay(500); | ||
+ | digitalWrite(green, LOW); | ||
+ | delay(2000); | ||
+ | |||
+ | digitalWrite(green, HIGH); | ||
+ | delay(500); | ||
+ | digitalWrite(green, LOW); | ||
+ | delay(500); | ||
+ | digitalWrite(green, HIGH); | ||
+ | delay(500); | ||
+ | digitalWrite(green, LOW); | ||
+ | delay(2000); | ||
+ | |||
+ | digitalWrite(green, HIGH); | ||
+ | delay(500); | ||
+ | digitalWrite(green, LOW); | ||
+ | delay(2000); | ||
+ | |||
+ | digitalWrite(green, HIGH); | ||
+ | delay(500); | ||
+ | digitalWrite(green, LOW); | ||
+ | delay(500); | ||
+ | digitalWrite(green, HIGH); | ||
+ | delay(500); | ||
+ | digitalWrite(green, LOW); | ||
+ | delay(500); | ||
+ | digitalWrite(green, HIGH); | ||
+ | delay(500); | ||
+ | digitalWrite(green, LOW); | ||
+ | delay(2000); | ||
+ | |||
+ | digitalWrite(orange, HIGH); | ||
+ | delay(500); | ||
+ | digitalWrite(orange, LOW); | ||
+ | delay(500); | ||
+ | digitalWrite(orange, HIGH); | ||
+ | delay(500); | ||
+ | digitalWrite(orange, LOW); | ||
+ | delay(500); | ||
+ | digitalWrite(orange, HIGH); | ||
+ | delay(500); | ||
+ | digitalWrite(orange, LOW); | ||
+ | delay(5000); | ||
+ | |||
+ | } | ||
+ | |||
+ | |||
+ | /* | ||
+ | |||
+ | |||
+ | D1 mini | ||
+ | BROCHAGE | ||
+ | _________________ | ||
+ | / D1 mini \ | ||
+ | |[ ]RST TX[ ]| | ||
+ | |[ ]A0 -GPIO RX[ ]| | ||
+ | |[ ]D0-16 5-D1[ ]| SCL | ||
+ | |[ ]D5-14 4-D2[ ]| SDA | ||
+ | |[ ]D6-12 0-D3[ ]| | ||
+ | |[ ]D7-13 2-D4[ ]| LED_BUILTIN | ||
+ | |[ ]D8-15 GND[ ]| | ||
+ | |[ ]3V3 . 5V[ ]| | ||
+ | | +---+ | | ||
+ | |_______|USB|_______| | ||
+ | |||
+ | _______________ | ||
+ | */ //code pour la sélection des lettres avec les interrupteurs en binaire | ||
+ | #include <LiquidCrystal_I2C.h> | ||
+ | #include <string> | ||
+ | int i1=15; | ||
+ | int i2=13; | ||
+ | int i3=12; | ||
+ | int i4=14; | ||
+ | int i5=A0; | ||
+ | int i=0; | ||
+ | int btn=TX; | ||
+ | |||
+ | String w = "STALLONE"; | ||
+ | LiquidCrystal_I2C lcd(0x27, 16, 2); | ||
+ | void setup() { | ||
+ | // put your setup code here, to run once: | ||
+ | Serial.begin(9600); | ||
+ | pinMode(i1, INPUT); | ||
+ | pinMode(i2, INPUT); | ||
+ | pinMode(i3, INPUT); | ||
+ | pinMode(i4, INPUT); | ||
+ | pinMode(i5, INPUT); | ||
+ | |||
+ | // initialize LCD | ||
+ | lcd.init(); | ||
+ | // turn on LCD backlight | ||
+ | lcd.backlight(); | ||
+ | |||
+ | } | ||
+ | |||
+ | void loop() { | ||
+ | // put your main code here, to run repeatedly: | ||
+ | int etatI1 = digitalRead(i1); | ||
+ | int etatI2 = digitalRead(i2); | ||
+ | int etatI3 = digitalRead(i3); | ||
+ | int etatI4 = digitalRead(i4); | ||
+ | int etatI5 = digitalRead(i5); | ||
+ | |||
+ | |||
+ | if(etatI5==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("A"); | ||
+ | |||
+ | } | ||
+ | else if(etatI4==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("B"); | ||
+ | } | ||
+ | else if(etatI4==HIGH && etatI5==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("C"); | ||
+ | } | ||
+ | else if(etatI3==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("D"); | ||
+ | } | ||
+ | else if(etatI3==HIGH && etatI5==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("E"); | ||
+ | } | ||
+ | else if(etatI3==HIGH && etatI4==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("F"); | ||
+ | } | ||
+ | else if(etatI3==HIGH && etatI4==HIGH && etatI5==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("G"); | ||
+ | } | ||
+ | else if(etatI2==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("H"); | ||
+ | } | ||
+ | else if(etatI2==HIGH && etatI5==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("I"); | ||
+ | } | ||
+ | else if(etatI2==HIGH && etatI4==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("J"); | ||
+ | } | ||
+ | else if(etatI2==HIGH && etatI4==HIGH && etatI5==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("K"); | ||
+ | } | ||
+ | else if(etatI2==HIGH && etatI3==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("L"); | ||
+ | } | ||
+ | else if(etatI2==HIGH && etatI3==HIGH && etatI5==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("M"); | ||
+ | } | ||
+ | else if(etatI2==HIGH && etatI3==HIGH && etatI4==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("N"); | ||
+ | } | ||
+ | else if(etatI2==HIGH && etatI3==HIGH && etatI4==HIGH && etatI5==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("O"); | ||
+ | } | ||
+ | else if(etatI1==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("P"); | ||
+ | } | ||
+ | else if(etatI1==HIGH && etatI5==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("Q"); | ||
+ | } | ||
+ | else if(etatI1==HIGH && etatI4==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("R"); | ||
+ | } | ||
+ | else if(etatI1==HIGH && etatI4==HIGH && etatI5==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("S"); | ||
+ | } | ||
+ | else if(etatI1==HIGH && etatI3==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("T"); | ||
+ | } | ||
+ | else if(etatI1==HIGH && etatI3==HIGH && etatI5==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("U"); | ||
+ | } | ||
+ | else if(etatI1==HIGH && etatI3==HIGH && etatI4==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("V"); | ||
+ | } | ||
+ | else if(etatI1==HIGH && etatI3==HIGH && etatI4==HIGH && etatI5==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("W"); | ||
+ | } | ||
+ | else if(etatI1==HIGH && etatI2==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("X"); | ||
+ | } | ||
+ | else if(etatI1==HIGH && etatI2==HIGH && etatI5==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("Y"); | ||
+ | } | ||
+ | else if(etatI1==HIGH && etatI2==HIGH && etatI4==HIGH){ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("Z"); | ||
+ | } | ||
+ | else{ | ||
+ | // set cursor to first column, first row | ||
+ | lcd.setCursor(0, 0); | ||
+ | // print message | ||
+ | lcd.print("no"); | ||
+ | |||
+ | } | ||
+ | |||
+ | /* | ||
+ | if(digitalRead(btn)==HIGH){ | ||
+ | |||
+ | if(lcd.read()==w[i]){ | ||
+ | lcd.setCursor(0, 1); | ||
+ | lcd.print("ok"); | ||
+ | i+=1; | ||
+ | } | ||
+ | else{ | ||
+ | i=0; | ||
+ | } | ||
+ | |||
+ | |||
+ | }*/ | ||
+ | |||
+ | } | ||
+ | |||
</pre> | </pre> | ||
Ligne 48 : | Ligne 409 : | ||
[[Catégorie:Enib2023]] | [[Catégorie:Enib2023]] | ||
+ | |||
+ | [[Catégorie:Arduino]] |
Version actuelle datée du 15 janvier 2024 à 16:00
Sommaire
Photo de l'équipe
Que fait ce projet ?
C'est un escape game centrée sur la langue des signes. Il faut se repérer à travers le puzzle de manière à trouver le mot caché. Du code cachée, à des séquences cachées il faut manœuvrer de manière subtile. Les leds sont de bons conseils.
Liste des composants
- Leds
- écran LCD
- interrupteur
- carte arduino
- cables
- images
Avancé du projet
Pour décrypter les lettres du code, le joueur devra comprendre des lettres en langues des signes (Un documentation est donné mais par forcément l'ordre ... )
Décor
Afin de placer un décor dans le style, nous avons créer sur inkskate nos propres images. Grâce à la découpe laser, nous avons pu le mettre sur une planche de bois. Les dessins n'ont pas été choisis par hasard, ils ont un rapport avec le mot à trouver.
Ici se trouve le fichier pour la réserve de carte
Ici se trouve le fichier du ring de box
Code
/* D1 mini BROCHAGE _________________ / D1 mini \ |[ ]RST TX[ ]| |[ ]A0 -GPIO RX[ ]| |[ ]D0-16 5-D1[ ]| SCL |[ ]D5-14 4-D2[ ]| SDA |[ ]D6-12 0-D3[ ]| |[ ]D7-13 2-D4[ ]| LED_BUILTIN |[ ]D8-15 GND[ ]| |[ ]3V3 . 5V[ ]| | +---+ | |_______|USB|_______| _______________ 2 fois jaune */ int green=0; int yellow=4; int orange=2; void setup() { Serial.begin(9600); pinMode(green, OUTPUT); pinMode(yellow, OUTPUT); pinMode(orange, OUTPUT); } void loop() { //code qui allume les leds dans l'ordre des cartes digitalWrite(yellow, HIGH); delay(500); digitalWrite(yellow, LOW); delay(500); digitalWrite(yellow, HIGH); delay(500); digitalWrite(yellow, LOW); delay(2000); digitalWrite(orange, HIGH); delay(500); digitalWrite(orange, LOW); delay(2000); digitalWrite(yellow, HIGH); delay(500); digitalWrite(yellow, LOW); delay(500); digitalWrite(yellow, HIGH); delay(500); digitalWrite(yellow, LOW); delay(500); digitalWrite(yellow, HIGH); delay(500); digitalWrite(yellow, LOW); delay(2000); digitalWrite(green, HIGH); delay(500); digitalWrite(green, LOW); delay(500); digitalWrite(green, HIGH); delay(500); digitalWrite(green, LOW); delay(2000); digitalWrite(green, HIGH); delay(500); digitalWrite(green, LOW); delay(500); digitalWrite(green, HIGH); delay(500); digitalWrite(green, LOW); delay(2000); digitalWrite(green, HIGH); delay(500); digitalWrite(green, LOW); delay(2000); digitalWrite(green, HIGH); delay(500); digitalWrite(green, LOW); delay(500); digitalWrite(green, HIGH); delay(500); digitalWrite(green, LOW); delay(500); digitalWrite(green, HIGH); delay(500); digitalWrite(green, LOW); delay(2000); digitalWrite(orange, HIGH); delay(500); digitalWrite(orange, LOW); delay(500); digitalWrite(orange, HIGH); delay(500); digitalWrite(orange, LOW); delay(500); digitalWrite(orange, HIGH); delay(500); digitalWrite(orange, LOW); delay(5000); } /* D1 mini BROCHAGE _________________ / D1 mini \ |[ ]RST TX[ ]| |[ ]A0 -GPIO RX[ ]| |[ ]D0-16 5-D1[ ]| SCL |[ ]D5-14 4-D2[ ]| SDA |[ ]D6-12 0-D3[ ]| |[ ]D7-13 2-D4[ ]| LED_BUILTIN |[ ]D8-15 GND[ ]| |[ ]3V3 . 5V[ ]| | +---+ | |_______|USB|_______| _______________ */ //code pour la sélection des lettres avec les interrupteurs en binaire #include <LiquidCrystal_I2C.h> #include <string> int i1=15; int i2=13; int i3=12; int i4=14; int i5=A0; int i=0; int btn=TX; String w = "STALLONE"; LiquidCrystal_I2C lcd(0x27, 16, 2); void setup() { // put your setup code here, to run once: Serial.begin(9600); pinMode(i1, INPUT); pinMode(i2, INPUT); pinMode(i3, INPUT); pinMode(i4, INPUT); pinMode(i5, INPUT); // initialize LCD lcd.init(); // turn on LCD backlight lcd.backlight(); } void loop() { // put your main code here, to run repeatedly: int etatI1 = digitalRead(i1); int etatI2 = digitalRead(i2); int etatI3 = digitalRead(i3); int etatI4 = digitalRead(i4); int etatI5 = digitalRead(i5); if(etatI5==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("A"); } else if(etatI4==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("B"); } else if(etatI4==HIGH && etatI5==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("C"); } else if(etatI3==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("D"); } else if(etatI3==HIGH && etatI5==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("E"); } else if(etatI3==HIGH && etatI4==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("F"); } else if(etatI3==HIGH && etatI4==HIGH && etatI5==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("G"); } else if(etatI2==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("H"); } else if(etatI2==HIGH && etatI5==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("I"); } else if(etatI2==HIGH && etatI4==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("J"); } else if(etatI2==HIGH && etatI4==HIGH && etatI5==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("K"); } else if(etatI2==HIGH && etatI3==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("L"); } else if(etatI2==HIGH && etatI3==HIGH && etatI5==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("M"); } else if(etatI2==HIGH && etatI3==HIGH && etatI4==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("N"); } else if(etatI2==HIGH && etatI3==HIGH && etatI4==HIGH && etatI5==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("O"); } else if(etatI1==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("P"); } else if(etatI1==HIGH && etatI5==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("Q"); } else if(etatI1==HIGH && etatI4==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("R"); } else if(etatI1==HIGH && etatI4==HIGH && etatI5==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("S"); } else if(etatI1==HIGH && etatI3==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("T"); } else if(etatI1==HIGH && etatI3==HIGH && etatI5==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("U"); } else if(etatI1==HIGH && etatI3==HIGH && etatI4==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("V"); } else if(etatI1==HIGH && etatI3==HIGH && etatI4==HIGH && etatI5==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("W"); } else if(etatI1==HIGH && etatI2==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("X"); } else if(etatI1==HIGH && etatI2==HIGH && etatI5==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("Y"); } else if(etatI1==HIGH && etatI2==HIGH && etatI4==HIGH){ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("Z"); } else{ // set cursor to first column, first row lcd.setCursor(0, 0); // print message lcd.print("no"); } /* if(digitalRead(btn)==HIGH){ if(lcd.read()==w[i]){ lcd.setCursor(0, 1); lcd.print("ok"); i+=1; } else{ i=0; } }*/ }