This project is an Arduino-based Spotify controller that allows you to display the currently playing track on an LCD screen and add the track to your liked songs using a button.
- Arduino board
- LCD screen (I2C)
- Button
- WiFi module (if not integrated)
- Necessary wiring and breadboard
-
Clone the repository:
git clone <repository_url> cd <repository_directory>
-
Install necessary libraries:
WiFi.hHTTPClient.hArduinoJson.hLiquidCrystal_I2C.h
-
Configure WiFi: Update the WiFi credentials in
main.ino:const char* ssid = "WIFI_SSID"; const char* password = "WIFI_PASSWORD";
-
Get Spotify Access Token: Update the Client credentials in
get_token.py:CLIENT_ID = "CLIENT_ID" CLIENT_SECRET = "CLIENT_SECRET"
Follow the steps in
get_token.pyto obtain your Spotify access token and updatemain.ino:const char* access_token = "PASTE_ACCESS_TOKEN_HERE";
-
Upload the code: Upload the
main.inofile to your Arduino board.
-
Power the Arduino: Connect your Arduino to a power source.
-
Connect to WiFi: The Arduino will automatically connect to the configured WiFi network.
-
Display Current Track: The currently playing track will be displayed on the LCD screen.
-
Like a Track: Press the button to add the currently playing track to your liked songs on Spotify.
main.ino: Main Arduino code.get_token.py: Script to obtain Spotify access token.spotify.h: Header file for Spotify API functions.spotify.cpp: Implementation of Spotify API functions.
This project is licensed under the MIT License.