|
CONTENTS Home Projects Electronics Graphics Java Java Mobile Other Stuff Resume Music Links To Friends Pictures Contact |
Parallax Propeller PokerRelated pages on www.mikekohn.net: picarus, msp430 guitar processor, 6581 Sound Chip, FPGA VGA, SX VGA, Atmel VGA, Bitbanging, Motor Control, Linksys Helicopter, PCI FPGA, Propeller Poker, Metal X Mod, Floppy Music, YJM Mod, DAC Sound, Remote Control, IR Guitar Pickup, Balsa Airplane, Garage Door, SD/MMC, Sony SIRC Infrared,, Tape Data Recorder, WWVB Binary Clock, RC Drag Racing, Thermometers, R/C Propeller RPM Introduction I got this Propeller development kit a while ago from http://www.parallax.com/, but never really had a chance to play with it. This is a pretty neat chip actually. It has eight 32 bit cores that run independently at speeds up to 80MHz. The devkit comes with VGA and PS/2 ports for keyboard and mouse and other stuff. It can be programmed in either assembly or a language called Spin and comes with a library of Spin objects for the keyboard, VGA, and other stuff. So finally a couple days ago I thought of this idea of doing a video poker game for Propeller so here it is. I took a bit of the logic from a Java version of this game that I did and translated it to Spin. Unfortunately, the VGA library ended up being a bit restrictive. Every 32x32 pixel block could only have two unique colors (out of a palette of 64 colors). Also, all the text and images I drew using a small python program I wrote that turned "ascii art" into Spin code I could paste into the .spin source. This was quite time consuming and tiring, so due all this the graphics here are quite 1983 looking, which actually I kinda like :). Anyway, if you want to run the development version game which you can download below, you'll need the Propeller devkit, a PS/2 keyboard, and a VGA monitor (or flat screen as I have in the picture below). Load the two spin programs and build the PropellerPoker.spin as the top module. On the keyboard: b = bet, 1-5 = hold cards 1 to 5, space = deal, and capital A = add more credits. The Final Product So after getting the game working on the development board, I wanted to build something for it. I was thinking of building a full poker machine cabinet, but I couldn't find a cheap LCD display to take apart for it, so I decided on just mounting everything to a piece of wood in the shape of a little table. I cut a coin slot in the wood and put an IR emitter and detector on either side so it can detect a coin falling through it. I also added a little speaker which I ripped out of an old Juice Box media player. Finally I added some little sheets of metal for buttons using a cap-sense circuit/software. Basically what it does is, if a finger is touching the metal piece, it acts like a capacitor. So I set the input pin on the micro to output and set it's value to 0 creating a virtual ground and discharging the "finger capacitor" for 1ms. Then I set the i/o pin back as an input and wait 5us (actually the page I read how to do this on said 5us, but for my resistors and such I'm doing 10us) before testing the value of the input. If the input is a 0, then the finger capacitor is being charged (aka, there is a finger on the metal piece so detect it as a button push) otherwise if there is a 1 on the i/o pin then the capacitance of the line was next to nothing and no finger is there. Probably I should have use shielded wire from the resistors to the metal plates, but I didn't have any and I was too cheap/lazy to go out and buy some. Using object-oriented techniques, I made my PokerKeyboard.spin module directly pretend to be the stock Parallax Keyboard.spin module so they can be substituted for each other. Or at least, I think I did.. I forgot to test this :). Video http://www.youtube.com/watch?v=0xinnBKeauM Pictures Schematic Download
For the propeller devkit:
PropellerPoker.spin
PokerDeck.spin
Copyright 1997-2010 - Michael Kohn
This page was designed to work with all standard HTML compatible web browsers including Firefox, IE, Safari, and Links. |