From de0afba0bfbee0c51a3d2d0a0574f2272b9498aa Mon Sep 17 00:00:00 2001 From: "UNIV-LYON1\\p2405212" Date: Mon, 16 Jun 2025 17:05:42 +0200 Subject: [PATCH] remove of choixModeJeu and choixDifficulty in web mod update oled web menu --- gra_21_morpion_lumineux_code.ino | 3 +++ menu.h | 8 ++++---- web.h | 11 +++++------ 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/gra_21_morpion_lumineux_code.ino b/gra_21_morpion_lumineux_code.ino index aba373e..9a38996 100644 --- a/gra_21_morpion_lumineux_code.ino +++ b/gra_21_morpion_lumineux_code.ino @@ -18,11 +18,13 @@ uint16_t currtouched = 0; void setup() { Serial.begin(115200); +/* if (!cap.begin(0x5B)) { Serial.println("MPR121 not found, check wiring?"); while (1); } Serial.println("MPR121 found!"); + */ setupMenu(); } @@ -31,6 +33,7 @@ void loop() { readButton(); if (!isPlay) { menu(); + Serial.println("ok"); } else { if (!local) { if(!isWebSet){ diff --git a/menu.h b/menu.h index 9e6b1b5..fe6ff1b 100644 --- a/menu.h +++ b/menu.h @@ -23,7 +23,7 @@ Adafruit_SH1107 display = Adafruit_SH1107(64, 128, &Wire); unsigned long lastDebounceTimeA = 0; unsigned long lastDebounceTimeB = 0; -const unsigned long debounceDelay = 200; // délai de rebond (200 ms) +const unsigned long debounceDelay = 200; void setupMenu() { pinMode(BUTTON_A, INPUT_PULLUP); @@ -88,12 +88,12 @@ void choixDifficulty() { void menu() { if (!isMod) { choixMode(); - } else if (!isModJeu) { + } else if (local && !isModJeu) { choixModeJeu(); - } else if (solo && !isDifficulty) { + } else if (local && solo && !isDifficulty) { choixDifficulty(); } else { - isPlay = true; // mode duo sans choix difficulté + isPlay = true; } } diff --git a/web.h b/web.h index 3ff08a4..95bf6c2 100644 --- a/web.h +++ b/web.h @@ -23,8 +23,11 @@ void setupWeb(){ display.clearDisplay(); display.setCursor(0, 0); - display.print("Connectez vous au\nreseau "); + display.println("Connectez vous a :"); + display.print("Nom : "); display.println(ssid); + display.print("Mdp : "); + display.println(password); display.println(); display.print("Puis accedez a \nl'adresse "); display.print(myIP); @@ -324,11 +327,7 @@ void loopWeb(){ client.println(); // the content of the HTTP response follows the header: - if(solo){ - webSolo(client); - }else{ - webGame(client); - } + webGame(client); client.println(); break; } else { // if you got a newline, then clear currentLine: