Ejercicio - Semaforo de LEDs — ESP32 simulation

An interactive ESP32 circuit simulation you can run free in your browser on Velxio, by haijin-dev.

Components

Sketch code

#include "src_Constant.h"
#include "controller_FlashingLed.h"
#include "device_Led.h"
#include "device_DistanceSensor.h"
#include "controller_DistanceMonitor.h"

FlashingLed* blueLed = NULL;
DistanceMonitor* distanceMonitor = NULL;

void setup() {
  Serial.begin(115200);
  blueLed = flashingled_new(PIN_13, 150 * MILLISECONDS);
  distanceMonitor = distancemonitor_new(PIN_2, PIN_23, PIN_22, PIN_21);
}

void loop() {
  flashingled_step(blueLed);
  distancemonitor_step(distanceMonitor);
}