#define ESP32 // so that settings.h works for all boards
#define WOKWI_USED
// Either: For using the C exercises, define this macro
// or: For using the Cpp exercises, uncomment this macro
// #define C_BEISPIELE
enum class Examples { // a list of all examples
First_Example, // see section ???
TrafficLights_in_C, // see section ???
TrafficLights_with_phases,
TrafficLights_FSM_with_busy_waiting,
TrafficLights_FSM_without_busy_waiting,
TrafficLights_table_driven_state_machine,
// Digital_Out, // see section ???
// Digital_In, // see section ???
AnalogIn_read_raw_values_in_C, // see section ???
AnalogIn_read_onboard_voltmeter_with_class, // see section ???
AnalogIn_Voltmeter,
AnalogIn_Temperature,
AnalogOut_Fade_LED_in_absolute_steps_ohne_Klassen,
AnalogOut_Fade_LED_in_percent_ohne_Klassen,
AnalogOut_Fade_LED_with_PWM_DA_Converter,
#ifdef ESP32
AnalogOut_Fade_LED_with_DAC_DA_Converter,
#endif
HC_SR04_Ultrasonic_Distance, // see section ???
last_value_without_comma
};
Examples example = Examples::AnalogOut_Fade_LED_in_absolute_steps_ohne_Klassen;
#include "utils.h"
#include "Trafficlights-in-C.h"
#include "Trafficlights.h"
#include "cpp-exercises.h"
void setup()
{
setup_serial_port();
Serial.println("ESP32 circuit for Embedded C++ (www.rkaiser.de)");
N_Cpp_Exercises::setup(example);
}
void loop()
{
N_Cpp_Exercises::loop(example);
}