/*
Wokwi link: https://wokwi.com/projects/410356722976869377
This sketch is used to test the functionality validation of the hardware settings for the Charlieplexed display.
The validation method is implemented in a minimal CharlieplexDisplay class.
I am developing this class on an ESP32 with the Arduino IDE. An previous version of this class already exists on my PC and I am using it as a reference.
But I found out, that the used structure of the settings is not suitable for my needs. So I decided to develop a total new structure for the definition of the display hardware.
Hopefully, it is published sometime on my github" There is already a similar sketch there with a very simple implementation.
This can be found on my github https://github.com/mikesch-1960/demo-Charlieplexing-ESP32-GPIO and can also be downloaded to wokwi.
*/
//#include "testDisplyConf.h" // A hardware setup for testing the validation rules
#include "display_7Pins_38Leds.h" // A hardware setup for a real existing display I found in a disposable vape
#include "CharlieplexDisplay.h" // Rudimentary class with the implementation of the validation method
CharlieplexDisplay display(display_pins, display_leds, display_digits, display_blocks);
void setup() {
Serial.begin(115200);
#ifdef BTN_PIN
pinMode(BTN_PIN, INPUT_PULLUP);
#endif
while (!Serial) {
delay(5);
}
delay(500);
Serial.println();
Serial.println("------------------------------------------------------------------");
Serial.println("--- Wokwi TEST-program! new Charliplex display class ---");
Serial.println();
//display.debugOut();
display.validateData();
Serial.printf("*** Display hardware: %d pins, %d leds, %d digits and %d blocks.\n", display.getPinCount(), display.getLedCount(), display.getDigitCount(), display.getBlockCount());
if (! display.validateData()) {
Serial.println("!!! Display data validation failed!");
// In a real application, I will set a flag to indicate that the setup() failed and the loop() do not execute the invalid display instance
return;
}
Serial.println("*** Display data validated successfuly!");
Serial.println();
Serial.println("Start executing the loop() function...");
}
void loop() {
delay(20);
}