StemX Lesson 1

7/24/23:

Today we used our StemX kits and started testing and doing some coding with our Raspberry Pi. We had to download an image of our choice and we got familiar with a screen detector which detects if the image we picked can be detected if it is on screen using Pyautogui. The code we used was definitely more advanced and if it is taught to other students, there needs to be more explaining in depth with what each piece of code does.

Additional Extension

We also got to make a weather receiver which uses an API key to find the temperature in different locations which is what you can see in the pictures below. I also took the freedom to make an extension of the code for future students seen below using Trinket. I had to get creative with importing different libraries as 'import requests' didn't work. This not only allows the user to find the temperature in different locations, but it also allows them to get a visual representation of the type of weather. This could have great potential and I made it to give an example of what could be done using this code.

Furthermore, we also got to work with the hardware of the Raspberry Pi and got to play with the LED's, learning how to do something simple like turning them on and off and how to control them using pushbuttons. We also connected this with our first code, so that when the image is detected in our screen, the LED turns on, and when the image isn't in our screen, it turns off.

We also learned how stoplights work and tried recreating them using LED's and our code. Every ten seconds, the green light turns yellow for two seconds, and then turns red for another ten seconds, and so on. We did this using an infinite while loop.

20230724_142503.mp4