// Beispiele zu dem Buch
// Richard Kaiser: STM32 Mikrocontroller Programmierung
// ??? wieder raus: 20.7.25, 13.53
// configuration macros so that this works for different boards (STM32 C031C6, ESP32
// and Raspberry Pico), gcc compiler versions and IDEs
// The macros RASPI, ESP32, STM32_NUCLEO identify the board
// used. They are defined in the ino file of the project.
#define STM32_C031C6
#ifdef STM32_C031C6
# define SMALL_MEMORY
# define STM32_NUCLEO
// For boards with little memory like STM32 C031C6 define
// one of these macros to compile only a part
# define PART_1_ONLY_FOR_BOARDS_WITH_LITTLE_MEMORY // Compile only the first part
// # define PART_2_ONLY_FOR_BOARDS_WITH_LITTLE_MEMORY
#endif
#define RUN_ON_WOKWI // define for running on Wokwi, and not an a real board
#ifndef SMALL_MEMORY // #define SMALL_MEMORY for boards with little memory (e.g. < 300KB)
# include <iostream>
#endif
#include <array>
#include <string>
#include "MC_Examples-w.h"
using namespace N_MC_Examples;
// Uncommment the namespace declaration
// from which you want setup and loop to execute.
// Uncommment exactly one.
#ifndef PART_1_ONLY_FOR_BOARDS_WITH_LITTLE_MEMORY
namespace activeNamespace = N_MC_Examples::N_3_2_1_introductory_example;
// namespace activeNamespace = N_MC_Examples::N_3_3_2_blink_LED;
// namespace activeNamespace = N_MC_Examples::N_3_3_3_Simple_Trafficlights;
// namespace activeNamespace = N_MC_Examples::N_3_3_4_FSM_Trafficlights;
// namespace activeNamespace = N_MC_Examples::N_3_3_5_Digital_Input_with_PushButton;
// namespace activeNamespace = N_MC_Examples::N_3_3_6_PushButton_with_Interrupt;
// namespace activeNamespace = N_MC_Examples::N_3_4_1_AnalogRead;
// namespace activeNamespace = N_MC_Examples::N_3_4_7_Distance_Sensor_HC_SR04;
// namespace activeNamespace = N_MC_Examples::N_3_6_1_fade_LED;
// namespace activeNamespace = N_MC_Examples::N_3_6_2_Audio;
#endif // #ifndef PART_1_ONLY_FOR_BOARDS_WITH_LITTLE_MEMORY
#ifndef PART_2_ONLY_FOR_BOARDS_WITH_LITTLE_MEMORY
// namespace activeNamespace = N_MC_Examples::N_3_6_Timer_interrupts;
namespace activeNamespace = N_MC_Examples::N_3_11_blink_LED_with_board_SDK; // ??? noch testen
#endif // #ifndef PART_2_ONLY_FOR_BOARDS_WITH_LITTLE_MEMORY
void setup()
{
activeNamespace::setup();
}
void loop()
{
activeNamespace::loop();
}