WEEK 4
I did two experiments. One experiment used a potentiometer as an analog input, the other used a photocell. I had some trouble making these work.
I'm writing this on Week 5. With Scott's help, I troubleshooted the problems I had last week.
- I kept connecting my circuit in such a way that the electricity will not want to flow through my switch and photocell. Since the electrons are lazy and would rather take the path of least resistance, I solved the problem simply by removing any wire that existed before my switch or photocell.
- I finally understand how to work with this formula:
pulse = ((sensorValue - minSensorValue) * pulseRange / sensorRange) + minPulse I felt that it was inconvenient to have to readjust my formula because the intensity of light in an environment keeps changing. So, the following is an Arduino code that would measure Minimum and Maximum amount of light and readjust the above formula every so often... in fact, whenever I press a set of two switches!