IoT - Modular - Baseline

From The TinkerNet Wiki
Jump to navigation Jump to search

This is the basis for pretty much ANY ESP-based firmware project. It'll get your device online.

main.cpp

 1 #include "TopSecret.h"
 2 #include "functions.h"
 3 
 4 void setup()
 5 {
 6   Serial.begin(115200);
 7   delay(50); // Delay to let the ESP get booted before sending out serial data
 8   Serial.printf("\n+---------------------------------------+\n");
 9   Serial.printf("|             ESP Baseline              |\n");
10   Serial.printf("+---------------------------------------+\n");
11 
12   setup_wifi();
13 
14   // Turn off the On-board LED (notice that it's inverted on most ESP boards)
15   pinMode(LED_BUILTIN, OUTPUT);
16   digitalWrite(LED_BUILTIN, HIGH);
17 }
18 
19 void loop()
20 {
21   // put your main code here, to run repeatedly:
22 }