I have attached a schematic of what my circuit looks like. However, I have switched the 100 ohm resistors with 10k resistors and swapped the positions of the resistors with the photocells.
Basically,
Vcc---->Photocell---->PIC's ADC<----10K resistor---->Gnd
Please keep in mind that this is already working on my partners robot. For some reason, all of a sudden the other day my ADC variables just stopped storing the correct values. For instance, I was able to use the battery voltage routine in my program to measure the total voltage of my circuit (i.e., up to 15v i believe). Of course that had to go through a voltage divider which i used 3 10k resistors and simply multiplied my variable by 3 and a few other things during calculation to get my result. This was working until a few days ago and now I can't seem to get anything right using my ADC. So far, everything else works fine (i.e., i can blink 8 leds on all 8 bits of PORTB).
Bookmarks