// 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"
using namespace N_MC_Utils;
#include "Unittests.h"
#include "MC_Examples.h"
///// using namespace N_MC_Examples_for_wokwi;
// using namespace ; // N_MC_Examples;
// Uncommment the namespace declaration
// from which you want setup and loop to execute.
// Uncommment exactly one.
//
// Uncommment the namespace declaration
// from which you want setup and loop to execute.
// Uncommment exactly one.
//
///// Examples from chapter 1
// ??? 20.7.25 Auf wokwi getestet ESP32 Raspi C031C6
// namespace activeNamespace = Chap_1_3_3_introductory_example; // ??? v v v
// namespace activeNamespace = Chap_1_4_1_Simple_Trafficlights_using_namespace_N_Pins;
// namespace activeNamespace = Chap_1_4_3_Digital_Input_with_PushButton; // ??? v v v
// namespace activeNamespace = Chap_1_4_4_Distance_Sensor_HC_SR04; // ??? v v v
// namespace activeNamespace = Chap_1_5_2_analog_read;
// namespace activeNamespace = Chap_1_5_2_analog_read;
// namespace activeNamespace = Chap_1_5_3_Voltmeter;
// namespace activeNamespace = Chap_1_5_4_Fade_LED_in_absolute_steps;
// namespace activeNamespace = Chap_1_5_3_Temperature;
// namespace activeNamespace = Chap_3_6_6_Voltmeter_float;
// namespace activeNamespace = Chap_3_6_6_Temperature_float;
// namespace activeNamespace = Chap_3_6_6_Fade_LED_in_absolute_steps_for_chapter_3;
// ??? namespace activeNamespace = chap_9_2_11_blink_LED; // ??? v v v
// ??? namespace activeNamespace = Chap_3_3_3_Simple_Trafficlights; // ??? v v v
// ??? namespace activeNamespace = Chap_3_3_4_FSM_Trafficlights; // ??? v v v
// ??? namespace activeNamespace = Chap_3_3_4_FSM_Trafficlights_mit_int_pins_3_4_4;
///// Examples from chapter 3
// namespace activeNamespace = Chap_3_4_1_AnalogRead; // ??? v v v
// namespace activeNamespace = Chap_3_4_9_1_PushButton_with_Interrupt; // ??? v v v
// namespace activeNamespace = Chap_3_6_1_fade_LED; // ???
// namespace activeNamespace = Chap_3_6_2_Audio; // ???
// namespace activeNamespace = Chap_3_4_9_Timer_interrupts; // ???
// namespace activeNamespace = Chap_3_7_onboard_unittests;
// namespace activeNamespace = Chap_3_8_8_conditional_code_generation_for_unittests;
///// Examples from chapter 6
// ??? namespace activeNamespace = Chap_6_2_6_Finite_State_Machine_with_enum_class_states;
// namespace activeNamespace = Chap_6_2_7_table_driven_Finite_State_Machine;
namespace activeNamespace = Chap_6_2_7_table_driven_Finite_State_Machine;
// namespace activeNamespace = N_Chap_6_2_8_Trafficlight_Unittests;
///// Examples from chapter ??? OO
void setup()
{
setup_serial_port();
show_gcc_version();
activeNamespace::setup();
}
void loop()
{
activeNamespace::loop();
}
Loading
pi-pico-2
pi-pico-2