Elliott's Color Sorting Robotic Arm

This is a picture of my robotic arm with a few new features like a light and a light sensor. The light sensor allows for more sorting abilities and the light is there because it turns on when the arm goes to pick up a brick. I also had to build a third bin because I added the color yellow. The robotic arm can now sort the ice cream (bricks) by color. I tested it many times on several different days and it worked great except sometimes the brick would slip out of the hand. The reason some of the procedures are in lower case is that those are the procedures for the color sensor.

Below is a picture and the programming.

TO PLACE.DISTANT
PICK.FROM.CHUTE
HAND.CLOSE
TALKTO [MOTORA LAMPD]
SETRIGHT
ON
WAITUNTIL [ANGLE5 < -60]
OFF
HAND.OPEN
END

TO PLACE.LOCAL
PICK.FROM.CHUTE
HAND.CLOSE
TALKTO [MOTORA LAMPD]
SETRIGHT
ON
WAITUNTIL [ANGLE5 < -49]
OFF
HAND.OPEN
END

TO PICK.FROM.CHUTE
TALKTO [MOTORA LAMPD]
SETLEFT
ON
WAITUNTIL [ANGLE5 > 0]
OFF
END

TO HAND.OPEN
TALKTO "MOTORB
SETLEFT
ONFOR 2.5
END

TO HAND.CLOSE
TALKTO "MOTORB
SETRIGHT
ONFOR 5
END

TO PLACE.ALL
PLACE.LOCAL
PLACE.DISTANT
PLACE.LOCAL
END

to sort.by.color
repeat 6[place.by.color]
end

to place.by.color
pick.from.chute
hand.close
talkto "motora
setright
on
waituntil [angle5 = -26]
off check.color
end

to check.color
if light6 > 40 [yellow]
if and light6 < 40 light6 >= 35 [red]
if light6 <= 34 [blue]
end

to blue
talkto "motora
setright
on
waituntil [angle5 = -50]
off
hand.open
end

to red
talkto "motora
setright
on
waituntil [angle5 = -31]
off
hand.open
end

to yellow
talkto "motora
setright
on
waituntil [angle5 = -61]
off
hand.open
end

Vina Danks HomePage|| Student Projects || Elliott's Robotic Arm