Crane Game

Claw games are everywhere and there are almost as dark mysterious and full of questionable content as the Internet. Patrick, Dan and Dave take you through the inner working of a claw game and then combine the two greatest sins of modern time, games of chance and the Internet to create an internet enabled claw game

We will tackle this project in a few steps. First we will get the board up and running then we will give access rights so that the web server can communicate with it.

Here is how to setup the K8055 board.
1) Download the libusb from sourceforge.net, compile and install
http://libusb.sourceforge.net
2) Download the libk8055 from sourceforge.net, compile and install
http://libk8055.sourceforge.net
3) Set the ID of the board to either 0/1/2/3

The syntax of the libk8055.
K8055 -p:3 -d:2
3 is the board address which you set with the jumpers on the board.
2 is the value of the digital outputs in 8 bit decimal

8 bit decimal cheat sheet
0 All digital outs off
1 Digital out 1 on all others off
2 Digital out 2 on all others off
4 Digital out 3 on all others off
8 Digital out 4 on all others off
16 Digital out 5 on all others off
32 Digital out 6 on all others off
64 Digital out 7 on all others off
128 Digital out 8 on all others off

If you want to have more than one switch on at a time then just add the two numbers together.
Example: 8+32=50 so -d:40 will turn on switches Digital 4 and Digital 6.
Example: 1+2+128=131 so -d:131 will turn on switches Digital 1,2 and 8.
Example 1+2+4+8+16+32+62+128=255 so -d:255 will turn all 8 switches on.

Here is how to give access to the k8055 board so that it can be controlled from the web.
1) Download and copy 50-velleman.rules to /etc/udev/rules.d/
2) chmod 4755 /usr/local/bin/k8055
3) chown nobody /usr/local/bin/k8055

We have included the entire webpage source for your viewing pleasure. Unzip the files and upload them to your server. You will also need to download prototype.js and place it inside the same directory as the rest of the pages.

Episode Links:
50-velleman.rules
cranegame.zip
vellemanusa.com
libusb.sourceforge.net
libk8055.sourceforge.net
debian.org
prototypejs.org