// Beispiele zu meinen Kursen
// Embedded C++ Grundkurs (www.rkaiser.de und www.tae.de)
// Embedded C++ Aufbaukurs (www.rkaiser.de und www.tae.de)
// sowie zu meinem Buch
// Modernes C++ für Embedded-Systeme
// Objektorientierte Mikrocontrollerprogrammierung
// und die MISRA C++:2023 Guidelines
// das mit einem Umfang von ca. 800 Seiten im Herbst 2026
// im Springer-Verlag erscheint.
// 7.8.2026: noch nicht fertig und oft noch verbesserungsbedürftig - RK
// Configuration macros so that MC_Utils.h, MC_Examples.h etc.
// work for different boards (STM32 C031C6, ESP32,
// Raspberry Pi Pico), gcc compiler versions (gcc 14, 15, 16)
// and IDEs (Arduino IDE, Visual Studio with Visual Micro,
// VS Code and PlatformIO)
#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
#include <Arduino.h>
#include <functional>
#include <cstdint>
#include "MC_Utils.h"
// #include "Trafficlights-in-C.h"
// #include "Trafficlights.h"
#include "MC_Examples.h"
using namespace N_MC_Examples;
// Uncommment the namespace declaration
// from which you want setup and loop to execute.
// Uncommment exactly one.
//
// ??? 20.7.25 Auf wokwi getestet ESP32 Raspi C031C6
// namespace activeNamespace = N_3_2_1_introductory_example; // ??? v v v
// namespace activeNamespace = N_3_3_2_blink_LED; // ??? v v v
namespace activeNamespace = N_3_3_3_Simple_Trafficlights; // ??? v v v
// namespace activeNamespace = N_3_3_4_FSM_Trafficlights; // ??? v v v
// namespace activeNamespace = N_3_3_5_Digital_Input_with_PushButton; // ??? v v v
// namespace activeNamespace = N_3_3_6_PushButton_with_Interrupt; // ??? v v v
// namespace activeNamespace = N_3_4_1_AnalogRead; // ??? v v v
// namespace activeNamespace = N_3_4_7_Distance_Sensor_HC_SR04; // ??? v v v
// namespace activeNamespace = N_3_6_1_fade_LED; // ???
// namespace activeNamespace = N_3_6_2_Audio; // ???
// namespace activeNamespace = N_3_6_Timer_interrupts; // ???
// namespace activeNamespace = N_3_11_blink_LED_with_board_SDK; // ???
void setup()
{
setup_serial_port();
show_gcc_version();
activeNamespace::setup();
}
void loop()
{
activeNamespace::loop();
}