Adding a distance sensor to the Bluefruit to show
that the closer a person is, the more rapid the cycling between generations
In the video, I demonstrate that when you put your hand in front of the distance sensor, the neopixel on the circuit will move rapidly between generations
What interactive element did you add? Why did you make that choice? How did you go about learning to use that component?
I added an RCWL-1601 ultrasonic sensor to my circuit. The reason why I chose this as my component is because I want to further my electronics skills by attaching a component to the circuit espeically since I want to do electrical engineering. Additionally, I want to make my own circuit so as to familiarize myself with things that I might not know what to do. The way I went about learning this component was by talking to Audrey about my idea, and she provided me resource to help me understand, and I found example code online to help me add new code to the sample code provided.
What changes did you make to the code or if you designed the code from scratch, how did you approach your algorithm design? How did that change the behavior from the original program?
I added more code to the sample code, such as defining parts of the components, to then be able to use it to calculate the duration, distance, and the evolution delay. The way I approached my algorithm design was by talking to Audrey about wanting to add a distance sensor to speed up the cycles, and then I further looked up how to add my components. I adapted the sample code to add my components, and if I got stuck, I would search online for other examples. The way my component changes the behavior of the original sample code is by speeding up the cycles if the distance sensor detects something in front of it.
What issues and challenges did you encounter? How did you get around those obstacles?
One of the issues I had was converting the distance to the evolution speed, but the way I fixed it by looking through the example code provided by Arduino IDE and looking at other people's example code. Additionally, another issue I had was distance kept printing 0 when there was something in front of it, and I kept changing elements of code only to realized its because I set my echo pin to 10 instead of 6, which fixed my issue.
What changes would you make on a future iteration of your project?
I remember Audrey mentioning or hearing in class that you can control the neopixel through your phone by having the data be sent to your device. I'm not sure how I might go about this, but I would be cool to incorporate that somehow into the ultrasonic sensor or the lights somehow.