Last active
January 13, 2022 17:23
-
-
Save loginov-rocks/40e418a9ec3267f09f5134f2ff425897 to your computer and use it in GitHub Desktop.
DIY Connected Espresso Machine: Over-the-Air Updates (Part 6) - main.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ArduinoOTA.h" | |
#include "EspressoMachine.h" | |
#include "WiFiManager.h" | |
#define SERIAL_BAUDRATE 9600 | |
#define WIFI_HOSTNAME "Connected-Espresso-Machine" | |
#define WIFI_ACCESS_POINT_SSID "Connected-Espresso-Machine" | |
#define OTA_UPDATES_HOSTNAME "connected-espresso-machine" | |
#define PUMP_RELAY_PIN D1 | |
#define BOILER_RELAY_PIN D2 | |
#define BOILER_IS_BOILING_PIN D5 | |
#define BOILER_IS_STEAM_PIN D6 | |
#define TOGGLE_PIN A0 | |
#define DONE_PIN D7 | |
EspressoMachine espressoMachine(PUMP_RELAY_PIN, BOILER_RELAY_PIN, BOILER_IS_BOILING_PIN, BOILER_IS_STEAM_PIN, TOGGLE_PIN, DONE_PIN); | |
// setupWiFi() | |
// setupOtaUpdates() | |
void setup() | |
{ | |
Serial.begin(SERIAL_BAUDRATE); | |
Serial.println("Setup..."); | |
setupWiFi(); | |
setupOtaUpdates(); | |
Serial.println("Setup was successful!"); | |
} | |
void loop() | |
{ | |
ArduinoOTA.handle(); | |
espressoMachine.work(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment