Timings You will need to put some delayl) calls in the program to allow for human reactions and to introduce some slowing of the process given a value read from distance sensor, converts it to centimeters, returning the result nsss delays betwee n readings. Returns the pressed state (HIGH or LOW)Įiven array with pin assignments for analog sensors, array to store readings, and size of the arrays, reads each sensor one time, storing the valuc to the corresponding reading array location. given button pin number, determines the pressed state (HIGH or LOW) of a button by taking 5 readings, repeating until all 5 are the same. They must perform the described tasks, and nothing more. ![]() General Algorithm * Determine button pressed state * Open and check output file Loop till button pressed o Magnet near hall sensor indicates Twix to be measured Turn on LE - Get 3 readings from each sensor, add them - Find average for each sensor's readings - Convert distance sensor reading to centimeters Write data to file -Wait for magnet to move away (Twix gone) Turn off LED Functions The following functions are required. In this manner, the program can be scaled up to include any number of analog sensors. This will be done by using arrays to hold the sensor pin numbers and the data read by them, sized to the number of sensors currently used. Since this is a prototyping of a system, you must allow for more sensors to be added. An LED will be lit when a Twix is in place and being measured. The Hall sensor will act as a sensor that a Twix is in place to be measured, and the button will be used to halt the program's run. prog2a.c-on the Pi This program will use the light and distance sensors to get data about the Twix. The second program will read that file and do analysis of the data. ![]() ![]() On the Pi you will do data collection, writing to a file. This project will be in two parts one specifically on Raspberry Pi and one that can be written/run on the Pi or your laptop. Your job is to write code to prototype a sensor system to separate the Twix and to determine how many are out of spec. And some also got through that don't quite meet quality specifications. There was some mix-up in the packing plant and a lot of left and right Twix got intermingled. Transcribed image text: Program Description You've probably seen the TV ads of Left Twix vs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |