Start
Motor for spindle
When action starts
Motor starts rotating to rotate spindle system
(@X rotations/sec)
once rotates X amount of times motor stops
for (;;){
Ultrasonic sensor begins to search
Void loop{
If
Ultrasonic receiver receives something
then
Go forward (towards the object) (@Xspeed)
Else
Continues searching (Rotates X degrees)
(repeat Ultrasonic sensor loop)
}
When to spin
Void loop{
If
Ultrasonic receiver receives input within X distance
Then
Bot stop and Bot starts to rotate (@ X speed)
Else
Continue Ultrasonic sensor searching loop
}
Ir Sensor
Void loop{
if
light bounces back to the reserves
then
back up and rotate X amount (@X speed)
else
keep searching
(repeat IR sensor loop)
}
}
End