From d9e3f27f3e26c48bb4ad96874736c5b99b17d87a Mon Sep 17 00:00:00 2001 From: Zach Wener Date: Sat, 17 Feb 2024 15:55:09 -0800 Subject: [PATCH] wifi --- 01OS/01OS/clients/esp32/playback.ino | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/01OS/01OS/clients/esp32/playback.ino b/01OS/01OS/clients/esp32/playback.ino index 61c800c..f9c597a 100644 --- a/01OS/01OS/clients/esp32/playback.ino +++ b/01OS/01OS/clients/esp32/playback.ino @@ -1,5 +1,6 @@ /*Press button to record,released button to playback*/ +#include #include #include @@ -17,6 +18,15 @@ uint8_t microphonedata0[1024 * 70]; int data_offset = 0; +void setupWiFi() { + WiFi.begin(ssid, password); + while (WiFi.status() != WL_CONNECTED) { + delay(500); + Serial.print("."); + } + Serial.println("Connected to WiFi"); +} + void InitI2SSpeakerOrMic(int mode) { esp_err_t err = ESP_OK; @@ -67,6 +77,7 @@ void InitI2SSpeakerOrMic(int mode) { void setup() { M5.begin(true, false, true); M5.dis.drawpix(0, CRGB(128, 128, 0)); + setupWiFi(); delay(2000); } @@ -92,4 +103,4 @@ void loop() { &bytes_written, portMAX_DELAY); } M5.update(); -} \ No newline at end of file +}