Poor Little Grisbot S3, I misprogrammed it this morning and instead of going forward it went backward — and off the table onto the floor. Despite landing upside down, it worked all right once I unbent the photocell leads.
Anyhow, here is the video of what I’ve programmed it to do now:
Programming this was a bit more challenging than I thought it would be. It ended up requiring multiple variables and calculations that broke the light responses into four zones:
(Click to enlarge.)
ZONE I: The left photocell reading is higher than the right, so we turn left.
ZONE II: The difference between left and right photocells is less than a set value, so we go forward.
ZONE III: The right photocell reading is higher than the left, so we turn right.
ZONE IV: The total of the left and right photocell readings is below a set value, so we stop.
Who sets the ‘set values?’ Why, the programmer does. And I’ll bet the robot behaves significantly different depending how they’re set.