Blog 4 - Analog Out

 Analog Out

In this iteration, i focused on expanding the previous setup by not just sending data up but also receiving data back down to the micro:bit. Using a recommendation from my classmates, i used a website called Adafruit to accomplish this.



I set up IFTTT to trigger whenever a song was added to my Spotify playlist, sending the track name to Adafruit via a webhook. Then, I created a proxy server on my local machine, which received the data from adafruit and forwarded it to the micro:bit
The proxy server was set up using flask, a lightweight and flexible python framework used for setting up web applications and API's. Using this i was able to set up a local server with a API that the micro:bit could request and access the data From Adafruit. Once the server received the data from Adafruit, using a recommendation from my classmate Brendan Mayer i extracted the data from the json before forwarding to the micro:bit

The micro:bit then is set to loop every few seconds and gets the server api, which returns the last song sent to the Adafruit website, then compares it with the previous recorded song and if changed will display the song recently added.

Challenges

I faced many issues with this iteration, one of these issued consisted of the limitations of the micro:bit, i was unable to do get requests to HTTPS, because of this i set the proxy server up in order to request from HTPP. I also faced an issue with the  http request, with help from Daniel Lawton i was able to configure the ip address that allowed for the http request to work.

Learned

From this iteration I've learned quite a bit, I've learned how to receive data back to the micro:bit using get requests. I've also leaned how to set up a proxy server using flask that can send and receive data from API requests. 

Comments

Popular posts from this blog

Blog 2 - HRV Demo

Week 1: HRV Review

Lock In Day 1 (20/05/25)