Go Down

Topic: Project 07 - How do you calculate the analog voltage ranges without trying (Read 596 times) previous topic - next topic

janv8000

Is it possible to get to the values mentioned in the project (1023,990 & 1010, 505 & 515, 5 & 10) without trying the buttons and seeing what the analogRead comes up with?

Eg. if I were to use resistors with values 100 ohm, 1K ohm, 100K ohm and 5 megaohm => what values should I put in my code?


rogertee

The analog inputs convert from an analog voltage to a digital format in bits when you have 0 volts on analog pin the digital output is 0 and when you have 5 volts input you get 1023. You can use the map to change these values. Normally a 10 k pot is used to adjust 0 to 5v but sensors can also be used. You can write values to serial monitor. I am not sure where you would be using 5 meg

Go Up