The circuit alone seems okay. Black underground will give me about 0.5V,
white areas make values of 5V and up (using 4 AA batteries).
When I connect that circuit to an AVR pin I will read about 5.3 V always.
What's wrong?
How can I modify the circuit to work?
Any clever alternatives?
In BASCOM-AVR I've done the following to read the pin:
Config Portc = Input ' make port c an input
Config Pinc.0 = Input ' want to use pin0 of port c
Reset Portc.0 ' to switch off pull-up,"set" doesn't work either
H = Pinc.0 ' read pin
Print "H: " ; H ' always "1", 5.3V
Connecting the pin to GND will change logical level so this works too...
Only the two together won't work.
Mind, I've already soldered the sensors according to the circuit
above (that is: connected the anode of the emitter to the collector
of the detector) and whats more glued the sensors to my robot with
epoxy so I would like to keep THAT part of the circuit ;)
Thank You,
Christoph
p.s.: nice idea with the forum, Mark. But for now I'll still cross post my
messages to the BASCOM mailinglist, sorry :)
Try to disable the "Reset Portc.0" because the pullup is it active when you say "config pinc.0 = input: Portc.0 = 1" disable also Config Portc = Input exept if use all for input.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum