The quiz will be available during the first few minutes of lab, which you will complete individually. Your lab TA will open the quiz and tell you the password you will need to get into the quiz for your section. For convenience, please click on your lab section below to access your quiz:
Section 10 am - https://forms.gle/g6PWyS6LxTqeqGjd7
Section 11 am - https://forms.gle/NFeeWBNEQvzXjgYcA
This lab will help you practice what we've learned about working with the CPX, and sharpen skills needed for Assignment 5.
For this lab, you will be creating a proximity warning system using the CPX.
To help you think of how this could work in real life, imagine that you are reversing a car or large truck. Being able to have something warn you when you are too close to a given object would be helpful in avoiding accidents or injuries.
We will be using the light sensor to indicate how near or far an object is. (Unfortunately, the CPX does not have a built-in distance sensor, but that would be pretty cool.) The idea behind this is that when the CPX detects a low amount of light, this means that some object is blocking light from getting to the light sensor on the CPX, so this object must be relatively close. On the other hand, if the CPX detects a high amount of light, this most likely means that there are no objects in the way.
In the Maker App, create an app that will work as follows:
When a low amount of light, or no light, is detected, the CPX will make a long sound to warn the user and all the color LEDs will turn red.
When a high amount of light is detected, the CPX will not make any noise and all the color LEDs will be white.
When a medium amount of light is detected, the CPX will make a short sound to warn the user and all the color LEDs will turn yellow. This would be somewhere in between the high and low threshold values, but closer to the low amount of light.
Use your best judgement to determine what a low/high amount of light is. It may depend on where you are working and how good the lighting is there, so you may need to experiment to see what the best threshold values would be.
Remember that you will need to Enable the Maker Toolkit within your app.
Find a partner, or if needed a group of 3 may be formed. You should each do your own work, but check in with each other as you work on the activity, ask questions, or share interesting things you find along the way. Offer feedback to each other.
The TAs will be available for any assistance needed, so please feel free to ask them any questions as well.
Once you are done, copy the link to your app from the Maker App. Turn this in on Gradescope, under "Lab 8: CPX Proximity Warning System."
This lab must be completed by 11:59pm on Tuesday, October 15, 2024. No late submissions will be accepted.
1 point: CPX changes sound based on amount of light detected. No noise is played with a high amount of light, a short sound is played with a medium amount of light, and a long sound is played with a low amount of light.
1 point: CPX changes the color LEDs based on amount of light detected. All the color LEDs are white with a high amount of light, yellow with a medium amount of light, and red with a low amount of light.
(No extra credit for this lab activity.)