// configuration macros so that cpp-excercises.h,
// utils.h etc work for different boards (STM32 C031C6, ESP32 and Raspberry Pico)
#define STM32_C031C6
#ifdef STM32_C031C6
# define SMALL_MEMORY
# define STM32_NUCLEO
#endif
#define WOKWI_USED
#ifdef STM32_C031C6 // Because of the small memory of the STM32_C031C6
// compile only parts the program
// set either PART_1 or PART_2
//#define PART_1
#define PART_2
#endif // STM32_C031C6
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
};
constexpr 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("STM32 circuit for Embedded C++ (www.rkaiser.de)");
N_Cpp_Exercises::setup(example);
}
void loop()
{
N_Cpp_Exercises::loop(example);
}