A Serial of Unfortunate Events

There's a happy ending I guess?

Continuing with the capacitive sensor I made last week, I wanted to make it recognize when I was close to the junction and then do something, which is similar to what I need for my final project. Most of this week was spent trying to understand and modify Neil's code for the Python GUI. Richard helped me to parse Neil's code and helped me to make preliminary changes to add a label that will recognize when you are close to the junction. I ran into some problems trying to initialize this variable, but in the end, I was able to get it to indicate when you were near or far, after some calibration.

When not touching the board at all
When touching near the junction

Next, Will O. suggested since my final project will attempt to do more than just read the serial, that I modularize the functions. The goal was to make a function that only reads the serial and to call it in another function that will do something with that information. For the final project, I want it to recognize if you are near a particular location and then choose to activate the servo motor to make the maze more difficult (i.e. move you away from the gap you are trying to enter). After learning a lot more about click and getting a lot more help on how to use it, I now have a simple command line application in which you can define the serial port and the baud rate. As you move around the capacitive sensor, it will alert you to when you are near to the junction. The rest of the functionality will be determined as my maze puzzle requires, but for now, I am just happy to understand how the code works and what is theoretically possible with it.

Here is my code for the command line application, modified from Neil's original .py file.

Special thanks to Richard, Will O., and Julia for their help this week!