Esp32 - Blinky
Jump to navigation
Jump to search
WebSite: OH&SW || MediaWiki: - Software - Hardware - Elektronik - Mechanik - Anhang
Übersicht
- Einfaches Beispiel zur Programmierung und zum Test eines Esp32-MicroControllers.
- Typische Hardware: Esp32UnoBoard mit Serieller-Usb-Schnittstelle.
- Funktion: nach dem Reset schreibt der Esp32 alle 1000ms die Message "Hello World!" über die Serielle Schnittstelle. Der Benutzer empfängt diese Nachricht mit einem Terminal-Programm.
Vorgabe
- Im Arduino-Projekt Esp32HelloWorld enthält die System-Konstante PERIOD_LEDSYSTEM die Vorgabezeit der An- / Aus-Zeit der LedSystem.
Quelltext
//-----------------------------------------
// Application: Esp32Blinky
// Version....: 01V01
// DateTime...: 2110141741
// Author.....: OMdevelop
//-----------------------------------------
//
//-----------------------------------------
// Definition
//-----------------------------------------
const int PIN_LEDSYSTEM = 2;
//
const int PERIOD_LEDSYSTEM = 1000; // [ms]
//
//
//-----------------------------------------
// Main - Setup
//-----------------------------------------
void setup()
{ // Configuration LedSystem
pinMode(PIN_LEDSYSTEM, OUTPUT);
}
//
//-----------------------------------------
// Main - Loop
//-----------------------------------------
void loop()
{ // LedSytem ON
digitalWrite(PIN_LEDSYSTEM, HIGH);
delay(PERIOD_LEDSYSTEM >> 1);
// LedSytem OFF
digitalWrite(PIN_LEDSYSTEM, LOW);
delay(PERIOD_LEDSYSTEM >> 1);
}
Hardware
- Esp32UnoBoard, allgemein jedes Esp32Board mit integrierter LedSystem.
Software
Wahlweise
- ArduinoIDE (Compiler-Benutzeroberfläche (Homepage: Arduino))
oder
- VisualStudioCode (Compiler-Benutzeroberfläche (Homepage: VisualStudioCode)).
Download
Datum | Uhrzeit | Projekt | Version | Download |
211014 | 1745 | ArduinoIDE(C-Code): Esp32ArdBlinky | 01V01 | 2110141745_Esp32ArdBlinky_01V01.zip |
21mmdd | hhmm | ArduinoIDE(Cpp-Code): Esp32ArdBlinky | 01V02 | 21xxxxxxxx_Esp32ArdBlinky_01V02.zip |
21mmdd | hhmm | VSCode(C-Code): Esp32VscBlinky | 02V01 | 21xxxxxxxx_Esp32VscBlinky_02V01.zip |
21mmdd | hhmm | VSCode(Cpp-Code): Esp32VscBlinky | 02V02 | 21xxxxxxxx_Esp32VscBlinky_02V02.zip |
WebSite:OH&SW || MediaWiki - Software - Hardware - Elektronik - Mechanik - Anhang || Datenschutz - Impressum