haut parleur radioweb
This commit is contained in:
parent
2bb1f8cae8
commit
0ae92c78e5
|
@ -12,5 +12,5 @@
|
||||||
platform = espressif32
|
platform = espressif32
|
||||||
board = esp32-devkitlipo
|
board = esp32-devkitlipo
|
||||||
framework = arduino
|
framework = arduino
|
||||||
monitor_speed = 9600
|
monitor_speed = 115200
|
||||||
lib_deps = esphome/ESP32-audioI2S@^2.0.7
|
lib_deps = esphome/ESP32-audioI2S@^2.0.7
|
||||||
|
|
70
src/main.cpp
70
src/main.cpp
|
@ -1,12 +1,12 @@
|
||||||
/*
|
/*
|
||||||
Simple Internet Radio Demo
|
Simple Internet Radio Demo
|
||||||
esp32-i2s-simple-radio.ino
|
esp32-i2s-simple-radio.ino
|
||||||
Simple ESP32 I2S radio
|
Simple ESP32 I2S radio
|
||||||
Uses MAX98357 I2S Amplifier Module
|
Uses MAX98357 I2S Amplifier Module
|
||||||
Uses ESP32-audioI2S Library - https://github.com/schreibfaul1/ESP32-audioI2S
|
Uses ESP32-audioI2S Library - https://github.com/schreibfaul1/ESP32-audioI2S
|
||||||
|
|
||||||
DroneBot Workshop 2022
|
DroneBot Workshop 2022
|
||||||
https://dronebotworkshop.com
|
https://dronebotworkshop.com
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Include required libraries
|
// Include required libraries
|
||||||
|
@ -29,42 +29,42 @@ String password = "lewifidecohabit";
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
|
|
||||||
// Start Serial Monitor
|
// Start Serial Monitor
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
|
|
||||||
// Setup WiFi in Station mode
|
// Setup WiFi in Station mode
|
||||||
WiFi.disconnect();
|
WiFi.disconnect();
|
||||||
WiFi.mode(WIFI_STA);
|
WiFi.mode(WIFI_STA);
|
||||||
WiFi.begin(ssid.c_str(), password.c_str());
|
WiFi.begin(ssid.c_str(), password.c_str());
|
||||||
|
|
||||||
while (WiFi.status() != WL_CONNECTED)
|
while (WiFi.status() != WL_CONNECTED)
|
||||||
{
|
{
|
||||||
delay(500);
|
delay(500);
|
||||||
Serial.print(".");
|
Serial.print(".");
|
||||||
}
|
}
|
||||||
|
|
||||||
// WiFi Connected, print IP to serial monitor
|
// WiFi Connected, print IP to serial monitor
|
||||||
Serial.println("");
|
Serial.println("");
|
||||||
Serial.println("WiFi connected");
|
Serial.println("WiFi connected");
|
||||||
Serial.println("IP address: ");
|
Serial.println("IP address: ");
|
||||||
Serial.println(WiFi.localIP());
|
Serial.println(WiFi.localIP());
|
||||||
Serial.println("");
|
Serial.println("");
|
||||||
Serial.print("coucou");
|
Serial.print("connected");
|
||||||
|
|
||||||
// Connect MAX98357 I2S Amplifier Module
|
// Connect MAX98357 I2S Amplifier Module
|
||||||
audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT);
|
audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT);
|
||||||
Serial.print("coucou");
|
Serial.print("coucou");
|
||||||
|
|
||||||
// Set thevolume (0-100)
|
// Set thevolume (0-100)
|
||||||
audio.setVolume(50);
|
audio.setVolume(100);
|
||||||
Serial.print("coucou");
|
Serial.println("toto");
|
||||||
audio.connecttohost("https://s4-webradio.antenne.de/antenne");
|
audio.connecttohost("http://194.97.151.146/antenne");
|
||||||
|
Serial.println("connexion antenne");
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop()
|
void loop()
|
||||||
|
|
||||||
{
|
{
|
||||||
// Run audio player
|
//Run audio player
|
||||||
Serial.print("coucou");
|
audio.loop();
|
||||||
audio.loop();
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue