Laura and Katie's Vending Machine

We made a Vending Machine, out of legos, in technology club. We programmed it to have a yellow lego come out of the slot when we put a yellow lego in the coin slot and the same with the blue. The legos that come out of the machine represent the food or drinks that come out of a real vending machine.

We had many difficulties in programming it. First the commands had spelling errors. After that was fixed, we found out that some of the wires on the control box were in the wrong place. It took a little time after we discovered that, to fix it. After that was fixed it started to work correctly.

We think this is so cool because we have never made anything with legos that was this high tech. This is more fun than K-NEX because it is a model of something that is used in real life and not just imaginary. We never used to like to play with legos until now because we had something fun and creative to build and it was more of a challenge. The procedures for our project are under the picture.

to yellow
talkto [ motora lampe soundc]
setleft
onfor 5
end

to blue
talkto [motorb lampf soundc]
setleft
onfor 5
end

to coin
waituntil [touch1]
tto "lampd onfor 10
check.color
coin
end

to check.color
If light8 >= 40 [yellow]
if and light8 >= 30 light8 < 40 [blue]
endto yellow
talkto [ motora lampe soundc]
setleft
onfor 5
end

to blue
talkto [motorb lampf soundc]
setleft
onfor 5
end

to coin
waituntil [touch1]
tto "lampd onfor 10
check.color
coin
end

to check.color
If light8 >= 40 [yellow]
if and light8 >= 30 light8 < 40 [blue]
end

Close-up of vending machine

Vina Danks Home Page || Student projects