Don't ad-block us - support your favorite websites. We have safe, unobstrusive, robotics related ads that you actually want to see - see here for more.
0 Members and 1 Guest are viewing this topic.
You ask for help in programming, but clearly your sensor is not working as intended, and no programming can fix that.
I'm sorry, but that's probably a wrong conclusion that you've made there^...
According to its manual, it is suppose to Switch its LED ON when it senses BLACK (or when nothing is in range) and Output should be Low. Likewise, if it senses White, that means: LED OFF, and Output = High !
For more than 12mm from any surface, LED is ON and the output = 8
For less than 3mm from any surface, LED is ON and the output = 8
Within the range, for any surface, LED is OFF and the output = 255
while(1){if(a2dConvert8bit(13)>127) do_something();else do_something_else();}