 |
The bot (Mary) starts out in a known location. Thanks to the Cye's
'bang into the right walls and you're home' localization routine, we're
pretty sure we are where we think we are. |
 |
Since we want to avoid the fringe, Mary cuts along the far edge of
the rug, and turns to move up the side |
 |
Now past the danger area, Mary moves in for the center of the rug. |
 |
At this point, Mary turns on the vacuum cleaner, by way of the Cyes
external output pin. This is an NPN transistor that drops to ground when
activated. So I feed the Cye +5V to one end of a relay coil, and the coils
connects to the output pin. When the output is off, the transistor does
not conduct, and the relay is de-energized. When the output is activated,
the transistor conducts, the relay coil energizes, and the vacuum turns
on.
This also activates a sweeping behavior, which causes Mary to move back
and forth about 10 inches, and swing the vacuum nozzle from side to side
about the same amount, thus cleaning a rough 10" by 10" area on the rug. |
 |
Once the area has been cleaned (by three repetitions of the vacuuming
behavior), Mary heads for home. Again, the sensitive fringe areas are avoided
by heading off the rug at an angle, and then returning to the start position
from the right side. |
 |
So now, depending on the accuracy of the Cye Encoders, Mary is back
at home, ready for the next spot vacuum command. |