================================= PiFace GungTank Operation Manual! ================================= ---------------------------- Turning on and shutting down ---------------------------- There is no on/off switch, just plug it into the adapter to turn it on. The socket is on the back left if the row of LEDs is on the bottom - and I should repeat the warning from the Pi manual to hold it by the edges and not any of the components when you do so :) You should see the power light come on, then the blue light on the wireless USB come on about thirty seconds later - after about a minute, it'll be ready to react. To turn it off, you... could just unplug it, I haven't had issues with it yet, but it's much better for the card if you shut it down first. To do this, download the Putty SSH client, point it at the address 192.168.0.114 and log in - the username is pi and the password is the same as your wireless connection. During the password entry, it won't show anything on the screen, not even asterisks - this is normal. Then type: sudo shutdown -h now You'll get a message saying the system is preparing for shutdown, and the wireless should turn off shortly afterwards. Give it thirty seconds or so and then unplug it (you should only see the steady red power light, along with whatever lights are on the PiFace). Now I think about it I could actually just write a webservice to do this... I've left the boxes and static-free bags behind for storage, they're at the head of the air mattress in the bedroom. ----------- Connections ----------- You know all of this already - it was far simpler than I had imagined at first! You just need a circuit with the 9-volt battery, the relay and the motor all in series. The ports to connect to are the two top-leftmost ones, when the row of LEDs is at the bottom of the board. --------------------------- Triggering over webservices --------------------------- The meat of the setup! The Pi is set up to accept several commands over HTTP, so anything with Internet access can call them - including manually with a web browser. I'll probably do a web UI for it in my spare time, but for now the command page is http://192.168.0.114/gt/go.php . (If you're outside your home network, use your IP address instead of 192.168.0.114.) Use this with these on the end to issue commands: ?command=init Must be called before you do anything else! (The games I've written do it automatically, though.) This initializes the interface so that it can accept further commands, and you'll see a light pattern blink on the Pi to confirm it's ready. ?command=hold The main event! This tells the Pi to activate the relay for just over half a second and then turn it off again, which is enough to pull the plug. You can also use it as ?command=hold&arg=X to activate the relay for X seconds, if in the future we need it to be longer. ?command=tick Tick for ten seconds by opening and closing the second relay. ?command=on Activate the relay and leave it on. ?command=off Turn off the relay. ?command=ping Toggle the last LED on the Pi. This is called by the games every five seconds just to ensure the Pi is still responding. ----- Games ----- So we've got three games so far! I'll send them over. Let me know if you come up with any more ideas... just now, games where you have a gap between playing and triggering it are the ones that work well (or games where the player at the computer is trying to save or gunge the other), but perhaps an old keyboard wrapped in clingfilm might work to make the experience more... direct :) Just now, if you run any of the games and the Pi isn't turned on or isn't responding, they'll just lock up... I'll work on fixing that. Have fun!