Close

PIC Modifications Implemented

A project log for Toy Claw Machine

Full size Claw machine made from misc. parts.

willbadenwillbaden 09/30/2014 at 02:190 Comments


The following has been implemented:

Allowed for communication with Claw machine mode via RS232 using the following menu structure:

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

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

exit
Exit out of menu and resume play.

This menu structure can be seen below:

The following will need to be implemented yet:

Save settings to EEPROM and pull settings from EEPROM on startup.

Add PWM for Claw closing

Allow serial data from RS232 port to control claw machine in normal operation

Be able to send messages to Matrix display (may not do  this one due to computer tieing up port)

Use App to control device (will need to setup the framwork for this)

A TTL to RS232 converter has been ordered and not delevered yet.  For the time being I used an UNO using the softwareserial function to allow for the UNO to act as the converter.  To program the PIC, I am using an older ICD2 and v7.6 MPLABs.  Here is a picture inside of the controller box with the attached items:

Discussions