Esp32 - Blinky

From Open Hard- & Software
Jump to navigation Jump to search

WebSite: OH&SW || MediaWiki: - Software - Hardware - Elektronik - Mechanik - Anhang

Übersicht[edit]

  • Einfaches Beispiel zur Programmierung und zum Test eines Esp32-MicroControllers.
  • Typische Hardware: Esp32UnoBoard mit integrierter LedSystem.
  • Funktion: nach dem Reset schaltet der Esp32 alle Sekunde für 500ms die LedSystem ON und danach für 500ms die LedSystem OFF.

Vorgabe[edit]

  • Im Arduino-Projekt Esp32 - Blinky enthält die System-Konstante PERIOD_LEDSYSTEM die Vorgabezeit der An- / Aus-Zeit der LedSystem.

Quelltext[edit]

//-----------------------------------------
//  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[edit]

  • Esp32UnoBoard, allgemein jedes Esp32Board mit integrierter LedSystem.
  • Usb-Verbindungskabel muss korrekt PC und Esp32UnoBoard verbinden.

2110141127_Esp32UnoBoard

Software[edit]

Wahlweise

oder

Download[edit]

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