diff --git a/examples/Login without refresh Token/login_without_rft.ino b/examples/Login without refresh Token/login_without_rft.ino new file mode 100644 index 0000000..da03a6f --- /dev/null +++ b/examples/Login without refresh Token/login_without_rft.ino @@ -0,0 +1,34 @@ +#include +#include +#include "SpotifyESP32.h" +#include "config.h" +using namespace Spotify_types; + +void connect_to_wifi(); + + +Spotify sp(CLIENT_ID, CLIENT_SECRET); + +void setup() { + Serial.begin(115200); + connect_to_wifi(); + + sp.begin(); + while(!sp.is_auth()){ + sp.handle_client(); + } + Serial.println("Authenticated"); +} + +void loop() { + // put your main code here, to run repeatedly: +} +void connect_to_wifi(){ + WiFi.begin(SSID, PASSWORD); + Serial.print("Connecting to WiFi..."); + while (WiFi.status() != WL_CONNECTED) { + delay(1000); + Serial.print("."); + } + Serial.printf("\nConnected to WiFi\n"); +}