// 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
// In diagram.json these lines
// [ "pico:GP0", "$serialMonitor:RX", "", [] ],
// [ "pico:GP1", "$serialMonitor:TX", "", [] ],
// were removed, so that
// Serial instead of Serial1
// can be used. (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 RASPI_PICO // so that utils.h works for all boards
#define RASPI RASPI_PICO_2 | RASPI_PICO_W | RASPI_PICO
#define WOKWI_USED
#ifdef WOKWI_USED
# ifdef RASPI
# define PRINTF_DOES_NOT_WORK
# include <stdio.h> // ??? does not enable printf for Wokwi Raspberry projects
# include "pico/stdlib.h" // ??? does not enable printf for Wokwi Raspberry projects
# endif
#endif // WOKWI_USED
#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();
}