Difference between revisions of "Esp32 - HelloWorld"
Jump to navigation
Jump to search
Line 12: | Line 12: | ||
<syntaxhighlight lang="c++" line> | <syntaxhighlight lang="c++" line> | ||
// | |||
//----------------------------------------- | |||
// Application: Esp32Blinky | |||
// Version....: 01V01 | |||
// DateTime...: 2110141741 | |||
// Author.....: OMdevelop | |||
//----------------------------------------- | |||
// | |||
//----------------------------------------- | |||
// Definition | |||
//----------------------------------------- | |||
const int PIN_LEDSYSTEM = 2; | const int PIN_LEDSYSTEM = 2; | ||
// | // | ||
const int PERIOD_LEDSYSTEM = 1000; // [ms] | const int PERIOD_LEDSYSTEM = 1000; // [ms] | ||
// | // | ||
// | |||
//----------------------------------------- | |||
// Main - Setup | |||
//----------------------------------------- | |||
void setup() | void setup() | ||
{ // Configuration LedSystem | { // Configuration LedSystem | ||
Line 21: | Line 36: | ||
} | } | ||
// | // | ||
//----------------------------------------- | |||
// Main - Loop | |||
//----------------------------------------- | |||
void loop() | void loop() | ||
{ // LedSytem ON | { // LedSytem ON | ||
Line 29: | Line 47: | ||
delay(PERIOD_LEDSYSTEM >> 1); | delay(PERIOD_LEDSYSTEM >> 1); | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 17:43, 14 October 2021
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 TIMESPAN_SERIALOUT die Vorgabezeit der periodischen Seriellen Ausgabe.
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 Serieller USB-Schnittstelle
Software
Wahlweise
- ArduinoIDE (Compiler-Benutzeroberfläche (Homepage: Arduino))
- mit Terminal innerhalb der ArduinoIDE
oder
- VisualStudioCode (Compiler-Benutzeroberfläche (Homepage: VisualStudioCode))
- mit Terminal innerhalb der IDE von VSCode
oder einem aktiven Terminal eigener Wahl
- HTerm (Terminal IDE (Homepage: Der Hammer)).
Download
ArduinoIDE(C-Code): 21xxxxxxxx_Esp32ArdBlinky_01V01.zip
ArduinoIDE(Cpp-Code): 21xxxxxxxx_Esp32ArdBlinky_01V02.zip
VSCode(C-Code): 21xxxxxxxx_Esp32VscBlinky_02V01.zip
VSCode(Cpp-Code): 21xxxxxxxx_Esp32VscBlinky_02V01.zip
Datum | Uhrzeit | Projekt | Version | Download |
211012 | 2115 | Esp32LanPowerSwitch | 01V03 | 2110122115_Esp32LanPowerSwitch_01V03.zip |
WebSite:OH&SW || MediaWiki - Software - Hardware - Elektronik - Mechanik - Anhang || Datenschutz - Impressum