In my code, attached, I'm programming three string pots to measure deflection for for my school project. This is my first time programming so any help will be much appreciated.
My problem is that I need to store the three maximum values from all three pots and display them. Display organization doesn't really matter at this point. All I need is to know how to keep track of maximum values. It seems very simple, but I couldn't find a straight answer.
My other issue is that the values of the analog read oscillates between two values. Are there any suggestions on how to fix that?
I called the manufacturer of the string pots and they recommended using a regulated power source like a 9v wall plug adapter. Which helped reduce the oscillation significantly but didn't stop it. I've also tried putting a 10 microF capacitor in parallel with the pots, which also didn't help.
All I need is to know how to keep track of maximum values.
For each pot declare a variable to hold the maximum and set them to zero. Each time you read a value compare it with the value of the variable. If it is greater than the value of the variable then set the variable to the new maximum value.
I was going to ask what a string pot was, but I googled the term first. So, now I want to know how you are programming a device that does not incorporate a microcontroller.