Danny and Ricky's Robotic Arm

We added a light sensor and a extra bin so it would sort our blocks by color. This took some time because the numbers the light sensor gave were different than our procedure said. We had 3 different colors. The colors were: Red, yellow and blue. Red gave the reading of 48. Yellow gave the reading of 52. Blue gave the reading of 36. Red had two different numbers depending on which side it looked at. This project was an interesting one. Our picture and procedures are below.

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

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

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

to red
talkto "motora
setright
on
waituntil [angle5 = -49]
off
hand.open
place.by.color
end

to blue
talkto "motora
setright
on
waituntil [angle5 = -37]
off
hand.open
place.by.color
end

to pick.from.chute
talkto "motora
setleft
on
waituntil [angle5 > 0]
off
end

to hand.open
talkto "motorb
setleft
onfor 5
end

to hand.close
talkto "motorb
setright
onfor 5
end

Vina Danks Home Page||Danny and Ricky's robotic arm