Test monitoring — ESP32-S3 simulation

An interactive ESP32-S3 circuit simulation you can run free in your browser on Velxio, by alireza-cs94.

Components

Sketch code

#include <Arduino.h>
#include <WiFi.h>
#include <LittleFS.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>


#define I2C_SDA   8
#define I2C_SCL   9
#define BTN_PIN   4
class SystemMonitor {
public:
  void begin(TwoWire &wire = Wire, uint8_t i2cAddr = 0x3C) {
      pinMode(BTN_PIN, INPUT_PULLUP);

          _display = new Adafruit_SSD1306(128, 64, &wire, -1);
              _display->begin(SSD1306_SWITCHCAPVCC, i2cAddr);
                  _display->clearDisplay();
                      _display->setTextColor(SSD1306_WHITE);
                          drawBootSplash();
                              _state = BOOTING;
                                }
                                    void bootStep(const char *msg, bool ok = true) {
                                        for (int i = 0; i < LOG_LINES - 1; i++) _bootLog[i] = _bootLog[i + 1];
                                            String line = ok ? "[x] " : "[ ] ";
                                                line += msg;
                                                    _bootLog[LOG_LINES - 1] = line;

                                                        _display->clearDisplay();
                                                            _display->setTextSize(1);
                                                                _display->setCursor(0, 0);
                                                                    _display->println("ESP32 OS  booting...");
                                                                        _display->drawLine(0, 9, 127, 9, SSD1306_WHITE);
                                                                            for (int i = 0; i < LOG_LINES; i++) {
                                                                                  _display->setCursor(0, 12 + i * 10);
                                                                                        _display->println(_bootLog[i]);
                                                                                            }
                                                                                                _display->display();
                                                                                                  }

                                                                                                      void bootFinish() {
                                                                                                          _display->clearDisplay();
                                                                                                              _display->setTextSize(2);
                                                                                                                  _display->setCursor(20, 24);
                                                                                                                      _display->println("READY");
                                                                              

More projects by alireza-cs94