Tx 的个人资料txbeard照片日志列表更多 ![]() | 帮助 |
|
2月17日 Nerdy Ramblings 7Woohoo!!!!! I found my dart board program. It turns out I did back it up to an obscure location on my computer.
If anyone is interested in messing with it, you will need Visual Basic Express 2008 and SQL Express 2008. I have put the original visual basic project files up on my "SkyDrive".
See, I am not a complete Idiot...... Some parts are missing......
2月15日 Nerdy Ramblings - 6Well, I was going to share my source code for the dart board program with Gabe, and made a frightening discovery.
I have lost my original program (due to my own ignorance), and must rewrite the program from scratch. My goal for the moment is to bang out new code by the end of the following weekend.
Since the original project was started, Microsoft has released Windows Vista, Visual Basic Express 2008, and SQL Express 2008. Therefore, I am going to start the program over from scratch, armed with the new operating system, and their new developer tools. Right now my plans are to make the source code available to the public when I am done.
Gawd!!!! I hate being brainless!!! It makes my head whistle on windy days, and causes me to have to redo projects I have already done once.
As my grand pappy, Ol' Reliable, used to tell me, "Son..... You are the creator of your own agony...."
I will post more as I get some time. 2月9日 Nerdy Ramblings 5I have just heard from a friend Gabe, who has pointed me in the right direction.
"Thank you Gabe"
The dartboard does require a switch response time of less than 1ms. Gabe told me about Hagstrom Electronics, who make a USB Keyboard encoder with a 12 x 12 matrix for connecting switches. For an additional $75 they will custom program the response time to less than 1ms for use with a dartboard.
They sell a "KE-USB24" that should work with the custom programmed response time. You can read more about the KE-USB24 at http://www.hagstromelectronics.com/products/ke_usb24.html.
This should allow me to program the key responses to match the work I have already done, and finally get the project finished this year. *grin* All I need is just a little more free time.
Once I scrape up some extra pennies, and get further along on my project, I will post some more information.
2月15日 Nerdy Ramblings 4 - Need another strategy.I have talked to a tech at x-keys about my issue with my dartboard. Here is the conclusion on using the dart board with x-keys:
The x-keys matrix board requires the switch closure to last a minimum of 30 ms. Manually pressing a dart board segment with my finger works perfectly; unfortunately, when throwing a dart at the board the switch closure last less than 30 ms.
After talking to the tech, I found out that this is by design to eliminate false signals due to noise.
Well.... To make a short story long, or vica-verse...
I am researching other alternatives with the Parallax Basic Stamp.
As an added note....
I had a friend come by, who was bragging on his new z-board (gamer's keyboard) for World of Warcraft. Not to be completely out done, I told him I may just hang my dartboard beside my desk, and setup macros. That way, I can just reach over and hit a segment on the dartboard to perform different actions. 1月22日 Nerdy Ramblings 4 - Another snagWell, I have the dart board assembled and connected to a computer using a USB Cable.
It all looked good, and tested good when I pressed on each segment of the dart board.
I received a response on the computer that cooresponded to the keys I had programmed. I have programmed the x-keys matrix board to respond with a "row - column" character string to represent which segment was pressed. Therefore, if I press a segment, I would receive "1 - 1", "8 - 11", etc.
This all looked good. I was ready to bang out the final code to have my dart board program receive input from the dart board, when I decided to try testing one more time. The only difference is this test used actual dart throws. I threw a dart, and did not get a response on the computer. After a few more throws, I did not receive any response. However, if I manually press on the segment with the dart, I would get a response.
I narrowed the problem down to one of two possibilities.
To test for the first problem, I began "whizzing" the darts harder and harder at the dart board to see if I could get a throw to register on the computer. There was no luck in getting a response on the computer. This got me thinking. As I began fanning the smoke from my face... *grin* I examined the original circuit board from the dartboard. I noticed that the traces from the switch matrix connection run directly to individual pins on the cpu. Ok... I figured that the cpu may have output pins that I might be able to tap into that would allow me to get this information to the computer via a serial or usb port. I then began to scour the Internet for any pinout information on an arachnid cpu. This must be a trade secret, because there is nothing to be found regarding this individual chip. I did come across a couple of interesting possibilities. I came across the Parallax Basic Stamp and the A-Wit CStamp, which are programmable micro controllers. I have been researching both of these options for a few days. I may have to program my own micro controller and interface it with my computer. Both chips have test kits that they call a BOE (Board of Education) that will connect to a PC. I have sent an email to X-Key's tech support to inquire about the response time of their matrix board. Once I hear back from them, I will have a better idea about what my next move is going to be. I have included a picture of the assembled dart board to date.
1月1日 Nerdy Ramblings 3 - The Dartboard HardwareOk.. I finally got some more spare time. I have been busier than 5 people lately, but still goofier than a pet coon. *grin*
I received my X-Keys USB matrix board, to use for interfacing my dartboard to my computer. I actually received it over a week ago, but could find enough time to experiment with it.
Alrighty then....
The X-Keys Matrix Board has a 30 pin header for connecting switches, power, and 2 LEDs. It also comes with a USB cable pre-connected for communication and 5V power from a computer. When examining the header pins we are only concerned with the 8 X 16 switch matrix, of which, we only need 8 rows and 11 columns for the actual dartboard interface. Having an extra 5 columns available will allow us to later connect switches for other things like a player button, game selection button, etc.
The X-Keys board has a connector that is two rows of 15 pins, and our dartboard's mylar strip has a connector with one row of 19 pins. For the dartboard, I simply de-soldered the original connector from the dartboards circuit board. To work with the X-Keys 30 pin connector I used a floppy cable for a computer. The floppy cable has 34 pins, but there is plenty of room on the board to allow the extra 4 pins to hang over on one side.
The next obstacle was to connect a female 34 pin connector with 2 rows of pins to a male connector with 1 row of 19 pins. Since my soldering skills are very rusty, much like my soldering tools, I decided to "McGyver" a connection. I first took an old floppy drive and desoldered the 34 pin connector for the ribbon cable. This gives my a conversion from a female connector to a 34 pin male connector. Next I took 5 audio cables for internal CD-ROM drives, and connected on end of each cable to the 19 pin dart board connector. I then removed the wire inserts on the other end of the audio cables using a straight pin. Now with a multi-meter in hand to test for continuity, I tested each wire so that I could connect them to the correct position on the 34 pin connector. Once done, I verified my connections testing each row and column on the X-Keys Matrix Board and the dart board connector side.
With the wiring connection complete and tested, it is time to concentrate on the X-Keys Matrix Board connection to the computer.
The X-Keys Matrix Board includes the programs "Macro Maker" and "Macro Manager". After installing the driver and software for the X-Keys Matrix board, I started with the "Macro Maker" program. The program starts by displaying an 8 X 11 grid of buttons. This program allows each button to be assigned a custom macro of keystrokes. I assigned each button with a set of keystrokes that corresponds to its row and column in the matrix. This way if I press the button in the first column of the first row, it will return the text "1-1". I did this for each button in an 8 X 11 grid. This will allow me to connect everything together, and press each segment of the dartboard to find its corresponding button on the matrix board. Now I can make a chart of each segment on the dart board, and write down which button in the switch matrix is attached to the segment, by simply pressing on each segment of the dart board while it is attached to the computer.
After creating the macro, the program allows it to be saved to the hard drive for loading and editing later. I saved the macro, and then ran the "Macro Manager" program. This allows the macro to be programmed into the matrix board for storage on the boards PROM (programmable ROM chip).
To test my setup, I opened notepad on my computer, with the matrix board attached, and began pressing various segments on the dart board. VIOLA!!!!!! Notepad filled up with "1-14-58-2" and more... It is working like a charm!!!!!
My next step is to actually create my chart of dart board segments to switch matrix numbers. Then I can go back and reprogram my macro to match the program I have written for the project.
I will post more as I get time......
I have also included some pictures of the different phases of the project.
11月29日 Nerdy Ramblings 2 - The Dart Board SoftwareBefore going in depth about the dartboard software, please keep in mind that this project was started on a whim. The code was hammered out in a rather short amount of time without extensive planning.
Ok... enough with the disclaimer....
The first thing I wanted to do was come up with an initial screen to allow the entry of the players and select the dart game to play. My first attempt was very crude and (IMHO) looked very "cheesy". I had a basic input screen, and immediately needed a cosmetic redesign. I then opened up one of my graphics programs (Ulead's Photo Impact) and designed a basic layout for the main program form. I set this image as the background for the main form in my program, and simply placed textboxes and other controls on the form.
Once I was comfortable with the basic look of the form, I also designed button images in Photo Impact as well.
I have included a screen shot of the current progress of the main form:
The next thing to do was to come up with a way to enter players into a database, so we can just pick a player without having to type their name everytime we decide to play.
Here is a screen shot of the player entry screen:
With main program form and the player entry forms done, it was time to concentrate on the "Score Board" form. The biggest complaint about our existing electronic dart board was how hard it was to see and determine who's turn it was, and what the scores were. So I set out to make sure we would be able to see each player and their scores clearly.
After designing several different forms, I finally settled on the following form for our score board:
This form seems pretty straight forward to me. Of course I don't know what everyone else will think. I designed this form with the same technique as the other forms. I used a background image, and then placed textboxes for the player names, scores, round number, and
individual dart throws. The 1, 2, 3, and X's are actually labels with transparent backgrounds.
With these forms done, I wanted to add sound to the program. Naturally, playing a wav file would be the easyest way to do this. I downloaded some sample wav files from various sites to come up with some "trash talking" sayings to play when different scores are hit. Rather than hard code variables for each sound to play, I setup seperate directories to hold the actual sound files for each event. Then I setup arrays for specific events and had the program parse each directory for files names. Currently the program allows up to 500 sound files per directory. This allows us to add, remove, or change sounds for the game by simply copying or deleting different wav files into its respective directory.
As an after thought, I read the article on "Coding 4 Fun" about the Visual Foos 2005 project. This project sounded so KEWL that I decided to play around with Microsoft's SpeechSDK. Now I can have the program actually announce the players name, or what they hit with their dart.
Well.... Duty Calls... So I will continue this when I get some more time..... 11月28日 Nerdy ramblings - Electronic Dart BoardI had started working on a little pet project earlier this year, and thought I would take some time to "babble" about it.
A bunch of friends and I started meeting on the weekends to go bowling and then come back to my place to BBQ in the evenings. After a couple of BBQ's we decided to break out an electronic dart board, and "duke it out".
Oh yeah.... Did I mention that bowling is not bowling, and BBQ's are not BBQs without.... um.... beer? Some of my friends would have me believe that beer acts like steroids for athletes. Their bowling scores improve, the BBQ tastes better, and they are better at darts when beer is applied.
I have noticed that their bowling improves to a point, but when it comes to darts.... The only thing that seemed to improve is their abuility to actually hit the reset or player buttons with a wild dart throw!!! Now, imagine trying to explain to a person wearing an "I beat sobriety" t-shirt, why their score is now zero, or why someone else's score went up when they threw a dart.
After several rounds of listening to discussions of how we need a dart board like they have at one of our local bars, I decided that was way to expensive.
Meanwhile....
Back at the ranch.....
I have decided to make our own electronic dart board. One that will display scores for up to 8 players, and display a players name (rather than "P1", "P2", etc.). The first obstacle to overcome would be figuring out how to connect an electronic dart board to a computer.
Fortunately, I had another old "Arachnid" dart board to use for experimenting. After disassembling the unit, I discovered that the dart board is just a couple of mylar sheets with contacts for switches, much like most of the inexpensive keyboards for a computer. With a little more research and examination, I have figured out that most dart boards are just a switch matrix (again like a computer keyboard). The difference between the two is the actual matrix for the switches.
My first idea was to simply take an old keyboard apart, remove the mylar switch matrix, and attach the dart boards switch contacts to the keyboards minature circuit board. Then I could test each segment on the dart board, to see which keystroke it represents. This would give me an easy way to interface my dart board to my computer as a second keyboard, and know what was hit by determining the keystroke. After all, a dart board has 80 segments/keys, and a computer keyboard has 104 keys.
Well.... That idea seemed brilliant, while it was on paper...
Unfortunately, the dart board has a matrix of 8 rows, and 11 columns. A keyboard's matrix (out of 5 that I examined) is 8 rows, and 9 columns. Also, each row from the keyboard is not mapped to every column. To make a long story short... or shorter... My idea was shot down in flames....
A little more research turned up the "X-Keys Matrix" board. I believe this will be the solution. It allows you to connect a group of switches to the board, and delivers input to the computer as keystrokes. All I should need is some kind of score form with a textbox to receive pre-determined keyboard input from the X-Keys.
To bring things up to date, I decided to concentrate on preparing the software using Visual Basic 2005 Express, and SQL 2005 express (for a database of players). I currently have the software close to ready.
I will add more information about my progress later.
|
|
|