Here is the fixed code. There were quite a few mistakes. Compare with your code to see what they were.
3202 pin numbers are wrong on your diagram. Be more careful.
This code reads the potentiometer only straight to the 3202 perfectly. From channel 0. (0 to 4095)
Potentiometer must be at least 5K
I did not fix your math or anything else.
I did not put in the voltage divider in the ckt but you need to use 10K resistors.
Connect the 3202 to the pins exactly as I have listed them in the constants, your ckt is wrong.
You cannot ground Din among other things. Read data sheet.
Call me if you want to discuss 217-359-6751
Harprit, thanks for the quick reply. I totally agree with you. I forgot and uploaded an old circuit diagram. As of now the Din is connected to one of the pins of the board, and I changed the pin setup a bit to make it more convenient for the wiring to happen, as everything just sits on my desk when I run it.
Though, Ive got one question. Why do I need at least a 5K Pot? Does that give me better resolution?
The pot sits across 5 volts and ground. The smaller the value the more current is uses
Resolution does not change. The A2d looks at the voltage at the wiper.
H
Comments
Here is the fixed code. There were quite a few mistakes. Compare with your code to see what they were.
3202 pin numbers are wrong on your diagram. Be more careful.
This code reads the potentiometer only straight to the 3202 perfectly. From channel 0. (0 to 4095)
Potentiometer must be at least 5K
I did not fix your math or anything else.
I did not put in the voltage divider in the ckt but you need to use 10K resistors.
Connect the 3202 to the pins exactly as I have listed them in the constants, your ckt is wrong.
You cannot ground Din among other things. Read data sheet.
Call me if you want to discuss 217-359-6751
Harprit
Though, Ive got one question. Why do I need at least a 5K Pot? Does that give me better resolution?
Thanks again for the help, I'll take a look.
Resolution does not change. The A2d looks at the voltage at the wiper.
H
Thanks.
H