|
Re: SW bug has ME stumped!!!
Sean - I think you are right if the bot is turned on with the UpSwitch turned on - then our code would be lost because the chain is at the bottom
the thing that has us stumped is we make sure the UP and Down switches are both off when we turn the bot on
but for some reason, it wont go up after that - it will go down, then up, (on the wrong side of the bottom paint mark) but not up - and not past the bottom mark.
Logically the only thing that can be happening is the OI is saying the upswitch is on for a loop or two at powerup, when its actully not on.
the code is a little tricky cause it has to do different things if the switch is on or off, and if the sensor is on or off - so we do catch the change of state by setting the variable only when the paint is not seen, and not changing it when the paint is seen
that way we know the 'state' of the motion the last time the chain was free to move - when we were not at the end.
I should have posted a flowchart with the code :^)
|