Gang...
I'm quite new to this, the last time I coded was when I used applesoft, so that's been 45 years ago,
Here's what I want to do.
I have eight voltage dividers. The voltage run from 0 to 5, each one of the eight will have a different range of voltages. Say divider one is .9 to 1.2V and divider is 1.3 to 2V and divider 3 is 2.2 to 3V and so on.
It took me hours to produce this little bit of code. Literally, hours. it works with only one divider.
right now, I'm at a lost.
The problem I can't seem to solve is how to determine the voltage on any of the eight dividers because even the best resistors in the world will drift. So, divider one may go from .9 to 1.2 V.
How do I check for that?
Then if I do another if (maybe a if else?)
and look at another divider, well shucks, divider 1 is already greater than 1.2 and will prove true. I can't have two actions true at the same time.
so in a nut shell;
how do i measure voltage on A0 when it varies from .9 to 1.2 V and have a return of true? Think of it as a window that's opened a tiny bit. Whatever comes in, between .9 and 1.2V must be true, yet ignore it when the voltage on A0 is higher than 1.2 V
And do it again for seven more times, each one will be looking for a different (make that higher) voltage than the other ones
there is some fluff in my code, mostly to give me an indication that what I'm asking it what it's doing like light an LED if the value is true. That part of the code isn't needed, however I wanted to prove the code actually did something.
I changed the value in my if statement and re run the sketch to verify that the condition changed. i.e. changed the if statement value to 4 so it won't return true
I sure could use some help
please don't laugh at my coding...It's all new to me
mike
antenna_Volt_read.ino (2.14 KB)


