Compare commits
2 Commits
11cf1cf782
...
61d9502e55
Author | SHA1 | Date | |
---|---|---|---|
61d9502e55 | |||
8bb37341f2 |
13
Makefile
Normal file
13
Makefile
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
PHONY:
|
||||||
|
|
||||||
|
compile: esp32_radio/esp32_radio.ino esp32_radio/wifiinfo.h
|
||||||
|
arduino-cli compile --fqbn esp32:esp32:esp32 esp32_radio
|
||||||
|
|
||||||
|
upload:
|
||||||
|
arduino-cli upload -p /dev/ttyUSB0 -b esp32:esp32:esp32 esp32_radio
|
||||||
|
|
||||||
|
watch:
|
||||||
|
screen /dev/ttyUSB0 115200
|
||||||
|
|
||||||
|
all: compile upload watch
|
||||||
|
|
@ -26,11 +26,27 @@ void setup() {
|
|||||||
pinMode(STATUSLED, OUTPUT);
|
pinMode(STATUSLED, OUTPUT);
|
||||||
pinMode(POWERBUTTON, INPUT);
|
pinMode(POWERBUTTON, INPUT);
|
||||||
|
|
||||||
|
esp_sleep_enable_ext0_wakeup(POWERBUTTON, 1);
|
||||||
|
|
||||||
|
esp_sleep_wakeup_cause_t source_reveil;
|
||||||
|
|
||||||
|
source_reveil = esp_sleep_get_wakeup_cause();
|
||||||
|
|
||||||
|
Serial.println(source_reveil);
|
||||||
|
|
||||||
|
switch(source_reveil){
|
||||||
|
case ESP_SLEEP_WAKEUP_EXT0 :
|
||||||
|
break;
|
||||||
|
default :
|
||||||
|
Serial.println("Deepsleep mod -- first boot");
|
||||||
|
delay(500);
|
||||||
|
esp_deep_sleep_start();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
wifi_init();
|
wifi_init();
|
||||||
wifi_info();
|
wifi_info();
|
||||||
|
|
||||||
esp_sleep_enable_ext0_wakeup(POWERBUTTON, 1);
|
|
||||||
|
|
||||||
audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT);
|
audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT);
|
||||||
audio.setVolume(30);
|
audio.setVolume(30);
|
||||||
// audio.connecttohost("http://192.168.2.216:8000/06%20-%20H4dopi.mp3");
|
// audio.connecttohost("http://192.168.2.216:8000/06%20-%20H4dopi.mp3");
|
||||||
|
Loading…
Reference in New Issue
Block a user