The idea behind this project was for my sons birthday party. He wanted a robot themed party, so I figured this would be the easiest to build.
Similar to the commercial claw machines, the idea is to grab a toy and successfully get it transferred over to the prize box (corner with a cutout). Unlike the commercial claws, this does not have a "decreased" power state of the claw mechanism, to hopefully allow for an easier chance to win a prize.
Overall it was an interesting and fun project to build, hacking it together using what I had on hand for motors/controls and building the frame work to contain it.
Via the serial port on the main board the following functions can be changed/modified.
Port Settings: 9600,8,N,1
prog
Enter into programming mode. Game play will be suspended after push button routine is finished (normal claw machine mode) or the button is released in test mode.
Response: ">"
spdx
Change speed of X axis. Can range from 1 - 255.
Response: "ENTER: "
User Response: <enter value from 1-255>
Response: "DONE" value was set
Response: "FAIL" value was discarded
spdy
Change speed of Y axis. Can range from 1 - 255.
Response: "ENTER: "
User Response: <enter value from 1-255>
Response: "DONE" value was set
Response: "FAIL" value was discarded
spdz
Change speed of Z axis. Can range from 1 - 255.
Response: "ENTER: "
User Response: <enter value from 1-255>
Response: "DONE" value was set
Response: "FAIL" value was discarded
timz
Change the amount of time that the claw will drop down while in "claw" or "pop" modes. Can range from 1 - 255.
Response: "ENTER: "
User Response: <enter value from 1-255>
Response: "DONE" value was set
Response: "FAIL" value was discarded
srtmrx
Change the timeout time for the x axis movement from serial port quick commands. Can range from 1 - 255.
Response: "ENTER: "
User Response: <enter value from 1-255>
Response: "DONE" value was set
Response: "FAIL" value was discarded
srtmry
Change the timeout time for the y axis movement from serial port quick commands. Can range from 1 - 255.
Response: "ENTER: "
User Response: <enter value from 1-255>
Response: "DONE" value was set
Response: "FAIL" value was discarded
test
Switch claw machine into test mode. In this mode, the push button acts as a "shift" key. Press and holding the button with the following inputs wil respond with the corresponding action:
Forward: Lower Claw
Back: Raise Claw
Left: Open Claw
Right: Close Claw
Response: "DONE" setting was accepted
Response: "FAIL" setting was discarded
claw
Switch claw machine into claw mode. In this mode, the claw machine will play normally.
Response: "DONE" setting was accepted
Response: "FAIL" setting was discarded
pop
Switch claw machine into pop mode. In this mode, the claw machine will lower the claw in the prize retrieval box prior to opening the claw. This will prevent the pop can from being dropped from above.
Response: "DONE" setting was accepted
Response: "FAIL" setting was discarded
exit
Exit out of menu and resume play.
exits
Save the settings to the EEPROM, exit out of menu and resume play.
Via the serial port, the claw machine can also take in quick commands. This will allow for the claw machine to be controlled by outside devices:
I
Move the claw machine forward (away from user). Every time this command is seen by the claw machine it will move the machine forward for the time set in "srtmry"
K
Move the claw machine backward (toward user). Every time this command is seen by the claw machine it will move the machine backward for the time set in "srtmry"
L
Move the claw machine right. Every time this command is seen by the claw machine it will move the machine right for the time set in "srtmrx"
J
Move the claw machine left. Every time this command is seen by the claw machine it will move the machine left for the time set in "srtmrx"
<spacebar>
If the claw machine is in "claw" or "pop" mode, the claw drop (prize retrieval) routine will run and lockout all user inputs (serial and joystick)