Added initial Melody Playback Ability
Now, controlled via MQTT a Playback of a melody can Start, Stop, Pause etc. Settings like speed, total duration, pauses etc can be set.
This commit is contained in:
41
build/sketch/ESP32_Utils.hpp
Normal file
41
build/sketch/ESP32_Utils.hpp
Normal file
@@ -0,0 +1,41 @@
|
||||
#line 1 "C:\\Users\\espi_\\Documents\\Arduino\\vesper\\ESP32_Utils.hpp"
|
||||
void ConnectWiFi_STA(bool useStaticIP = false)
|
||||
{
|
||||
Serial.println("");
|
||||
WiFi.mode(WIFI_STA);
|
||||
if(useStaticIP) {
|
||||
WiFi.config(ip, gateway, subnet);
|
||||
WiFi.setHostname(hostname);
|
||||
}
|
||||
WiFi.begin(ssid, password);
|
||||
|
||||
while (WiFi.status() != WL_CONNECTED) {
|
||||
delay(100);
|
||||
Serial.print('.');
|
||||
}
|
||||
|
||||
Serial.println("");
|
||||
Serial.print("Iniciado STA:\t");
|
||||
Serial.println(ssid);
|
||||
Serial.print("IP address:\t");
|
||||
Serial.println(WiFi.localIP());
|
||||
}
|
||||
|
||||
void ConnectWiFi_AP(bool useStaticIP = false)
|
||||
{
|
||||
Serial.println("");
|
||||
WiFi.mode(WIFI_AP);
|
||||
while(!WiFi.softAP(ssid, password))
|
||||
{
|
||||
Serial.println(".");
|
||||
delay(100);
|
||||
}
|
||||
|
||||
if(useStaticIP) WiFi.softAPConfig(ip, gateway, subnet);
|
||||
|
||||
Serial.println("");
|
||||
Serial.print("Iniciado AP:\t");
|
||||
Serial.println(ssid);
|
||||
Serial.print("IP address:\t");
|
||||
Serial.println(WiFi.softAPIP());
|
||||
}
|
||||
Reference in New Issue
Block a user