This is my LEGO Mindstorms EV3 robot that throws mini Halloween chocolate bars and candy. The EV3 Infrared sensor is used to detect when something is in front of the machine to trigger the delivery mechanism.
All the parts needed to build this model are in the LEGO retail Mindstorms set (number 31313). You can find the building instructions and the program file for running it on my website:
The chocolates are stored in a gravity feed stack and are pushed out from the bottom using a simple piston arm. Once they are pushed out, they land on a platform that is rotated up to throw the chocolate.