Scribbler 2 barcode sensor
I'm not having much luck having the robot sense barcode #1. I'm moving at 50% power directly over the barcode turning on the LEDs if it senses barcode 1, but it never does. I put the conditional test in a loop going from 1 to 10. Any hints?
Comments
-Phil
I've attached the .scb file. Am I doing something wrong?
-Phil
2. In an infinite loop, check for the barcode as you do now.
3. When it sees the barcode, have it flash its lights, then stop.
From there, you can build more complex behaviors.
-Phil
That worked. I see that the robot is sensitive to how much light is shining on the paper with the barcode on it. The success of this method seems to depend upon where I place the paper; if I put it at a certain place, it never works, and if I put it at a different place, it always works. It seems the brighter the room, the better.
Attached is the code you suggested that works.
One question: how do you get out of an infinite loop? I'm thinking, subroutine maybe?
Don Shepherd