One large hurdle overcame today. I now have the FSR Sensor outputs transferring to the Pi and displaying in real time within the Kivy app when running. I've added in a little if statement as well for a couple of sensors, if sensor 1 reaches a value of 400 or more, then a song will start playing. If sensor 2 reaches a value of 400 or more, this will then stop the music. This illustrates towards the final idea that I want to achieve, imagine say using a glove and the sensors placed at the fingertips, pinching various fingers together would trigger these actions. I also have 3 LED's connected to the Arduino, which turn on indicating the threshold values have been reached by the sensors as described above as a sort of visual indicator outside of the app.
Here's a video:
Sorry for the glare on the screen and the small writing is hard to see. Now that the functionality is pretty much there, I will start focusing on the aesthetics of it all more.
Python threading was the answer in the end. And I have to shout out my good friend Lewis Holmes who helped me with the underlying theory/methodology of threading and how it works to help get this code up and running and working. I will upload all the files of my coding so far with this date in the filenames (09,02.19). Also, following my friends advice, I have split up into multiple python files importing into the main, various parts of the GUI, so as to keep it more manageable.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.