add test unitaire

This commit is contained in:
M1n-0
2026-05-08 00:04:39 +02:00
parent fd0904acf5
commit 8b2f39ac5d
8 changed files with 477 additions and 146 deletions

52
test_boutons_droite.cpp Normal file
View File

@@ -0,0 +1,52 @@
#include <Arduino.h>
// Test uniquement des 5 boutons droite
const int rightButtons[5] = {
25, 33, 32, 4, 17
};
void setup() {
Serial.begin(115200);
delay(1000);
Serial.println();
Serial.println("===== TEST BOUTONS DROITE =====");
for (int i = 0; i < 5; i++) {
pinMode(rightButtons[i], INPUT_PULLUP);
Serial.print("Bouton droite ");
Serial.print(i + 1);
Serial.print(" sur GPIO ");
Serial.println(rightButtons[i]);
}
Serial.println();
Serial.println("Cablage attendu : GPIO ---- bouton ---- GND");
Serial.println("Relache = HIGH");
Serial.println("Appuye = LOW");
Serial.println();
}
void loop() {
Serial.println("----- ETAT BOUTONS DROITE -----");
for (int i = 0; i < 5; i++) {
int state = digitalRead(rightButtons[i]);
Serial.print("Bouton D");
Serial.print(i + 1);
Serial.print(" GPIO ");
Serial.print(rightButtons[i]);
Serial.print(" = ");
if (state == LOW) {
Serial.println("APPUYE");
} else {
Serial.println("relache");
}
}
Serial.println();
delay(500);
}