Table
| Step No. | Description | Action Item/Check | Expected Outcome |
|---|---|---|---|
| 1 | Power Supply Verification | Measure the output of U1 on the 3V3 net. | Stable output voltage of 3.3V. |
| 2 | Continuity Tests | Check continuity on critical paths. | No open paths; connections verified. |
| 3 | ESP32 Boot Test | Power on the ESP1. | ESP32 boots up successfully. |
| 4 | GPIO Pin Functionality | Test GPIO pins with a basic blink code. | LED (or other indicator) blinks. |
| 5 | Switch Functionality | Press SW1, SW2, SW3, SW4. | Each switch triggers the expected response. |
| 6 | LED Display Functionality | Activate segments on U2 via GPIOs. | Expected segments light up correctly. |
| 7 | Resistor and Capacitor Validation | Measure resistance and capacitance values. | Values close to expected (tolerance). |
| 8 | Signal Integrity Check | Use an oscilloscope on signal lines. | Signals show proper waveform without distortion. |
| 9 | Overall Integration Test | Run an integration test with all components. | System operates without error and as intended. |
| 10 | Debug and Logging Verification | Ensure any debug features are active. | Logs show accurate operation and assist in debugging. |
Key Adaptations:Cpp
// Definición de los pines para los segmentos de los displays const int segmentPinsTens[] = { GPIO_NUM_3, GPIO_NUM_5, GPIO_NUM_13, GPIO_NUM_16, GPIO_NUM_14, GPIO_NUM_12, GPIO_NUM_15 }; // a, b, c, d, e, f, g para las decenas const int segmentPinsUnits[] = { GPIO_NUM_17, GPIO_NUM_18, GPIO_NUM_19, GPIO_NUM_21, GPIO_NUM_22, GPIO_NUM_23, GPIO_NUM_25 }; // a, b, c, d, e, f, g para las unidades const int digitPins[] = { GPIO_NUM_22, GPIO_NUM_23 }; // Pines de dígitos const int buttonPin = GPIO_NUM_45; // Pin del pulsador para incrementar const int resetButtonPin = GPIO_NUM_44; // Pin del pulsador para reiniciar const int decrementButtonPin = GPIO_NUM_43; // Pin del pulsador para restar // Matriz para los números del 0 al 9 const byte numbers[10] = { B00111111, // 0 B00000110, // 1 B01011011, // 2 B01001111, // 3 B01100110, // 4 B01101101, // 5 B01111101, // 6 B00000111, // 7 B01111111, // 8 B01101111 // 9 }; int counter = 0; // Variable para el contador int lastButtonState = HIGH; // Estado anterior del botón para incrementar int currentButtonState; // Estado actual del botón para incrementar int lastResetButtonState = HIGH; // Estado anterior del botón de reinicio int currentResetButtonState; // Estado actual del botón de reinicio int lastDecrementButtonState = HIGH; // Estado anterior del botón para restar int currentDecrementButtonState; // Estado actual del botón para restar void setup() { // Configuración de los pines de los segmentos como salida for (int i = 0; i < 7; i++) { pinMode(segmentPinsTens[i], OUTPUT); pinMode(segmentPinsUnits[i], OUTPUT); } // Configuración de los pines de los dígitos como salida for (int i = 0; i < 2; i++) { pinMode(digitPins[i], OUTPUT); } // Configuración de los pines de los pulsadores como entrada pinMode(buttonPin, INPUT_PULLUP); pinMode(resetButtonPin, INPUT_PULLUP); pinMode(decrementButtonPin, INPUT_PULLUP); } void loop() { // Leer el estado actual del pulsador para incrementar currentButtonState = digitalRead(buttonPin); // Detectar si el botón ha sido presionado (cambio de estado de HIGH a LOW) if (lastButtonState == HIGH && currentButtonState == LOW) { counter++; if (counter > 99) { counter = 0; // Reiniciar el contador al llegar a 99 } displayNumber(counter); delay(300); // Anti-rebote para evitar múltiples lecturas } // Leer el estado actual del pulsador para reiniciar currentResetButtonState = digitalRead(resetButtonPin); // Detectar si el botón de reinicio ha sido presionado (cambio de estado de HIGH a LOW) if (lastResetButtonState == HIGH && currentResetButtonState == LOW) { counter = 0; // Reiniciar el contador displayNumber(counter); delay(300); // Anti-rebote para evitar múltiples lecturas } // Leer el estado actual del pulsador para restar currentDecrementButtonState = digitalRead(decrementButtonPin); // Detectar si el botón para restar ha sido presionado (cambio de estado de HIGH a LOW) if (lastDecrementButtonState == HIGH && currentDecrementButtonState == LOW) { counter--; if (counter < 0) { counter = 99; // Reiniciar el contador a 99 si es menor que 0 } displayNumber(counter); delay(300); // Anti-rebote para evitar múltiples lecturas } // Actualizar el estado anterior del botón lastButtonState = currentButtonState; lastResetButtonState = currentResetButtonState; lastDecrementButtonState = currentDecrementButtonState; } void displayNumber(int number) { int tens = number / 10; int units = number % 10; // Mostrar decenas digitalWrite(digitPins[0], LOW); digitalWrite(digitPins[1], HIGH); displayDigit(tens, segmentPinsTens); delay(5); // Mostrar unidades digitalWrite(digitPins[0], HIGH); digitalWrite(digitPins[1], LOW); displayDigit(units, segmentPinsUnits); delay(5); } void displayDigit(int digit, const int segmentPins[]) { for (int i = 0; i < 7; i++) { digitalWrite(segmentPins[i], !bitRead(numbers[digit], i)); // Invertir el valor para cátodo común } }
GPIO_NUM_X with the specific GPIO you intend to use for each segment and digit.segmentPinsTens and segmentPinsUnits accordingly.graph TD; V1["Power Source (5V)"] --> LM1117MPX["Voltage Regulator (LM1117MPX-3.3/NOPB)"] LM1117MPX -->|3.3V| ESP32["Microcontroller (ESP32-S3-DEVKITC-1)"]; ESP32 --> Display["Display Module (HDSM-541B)"]; UserInput1["Button (B3FS-1050P)"] -->|GPIO45| ESP32; UserInput2["Switch (MR1-110-C5N-BB)"] -->|3V3| ESP32; subgraph Power V1 --> U1; U1["Voltage Regulator (LM1117MPX-3.3/NOPB)"] --> ESP32; end subgraph User Interfaces SW1["Switch (B3FS-1050P)"] --> ESP32; SW2["Switch (B3FS-1050P)"] --> ESP32; end subgraph Display HDSM-541B["Display Module (HDSM-541B)"] --> ESP32 end
EasyCount_3.2.0
stiventorres24
copilot
Table