Home | Popsknot | TroyDPatterson.com

Another update

May 12th, 2010

The Bad News first(That way you have something good to look forward to)
My small pinball machine I was working on, the hack one. Failed in concept. It’s going to cost me more money than anticipated to finish it.
I lost my camera somewhere so it’s going to be a while before I post another photo of stuff I mindlessly purchase (Yay?)
I’m still swamped with projects, so another rebuild of this site is far off.

Now.. The Good News
My mother bought me a home sized pinball machine. I’m debating on hacking it up or not. My mother knew this and that’s why she bought it for me. It’s a Zizzle Pinball so… no one is going to miss it.
I’ve purchased that Screw Driver I always wanted. So.. I can finally finish taking apart the junk I found on the street and save the parts that I wanted. So at least my apartment is going to be cleaner.
Hopefully and fingers crossed. I’m going to put up a router(The tool not the network device) this weekend. That plus my Saw & screw Driver set are going to make for awesome projects!

Guff

May 4th, 2010

MadL Guff

Oooh I got a new book!

April 20th, 2010

I told you, “I am going to get back in to reading”.

Avalon Revisited Cover

I got board so I built this…

April 18th, 2010

… get it!? :)

Frame built from plywood.

Two more steps backwards

April 5th, 2010

So this is a quick entry. Last night I managed to break two relays that I thought were going to work in my pinball machine. So I’m researching a better method for working the flippers.

Keyboard LEDs

March 26th, 2010

While I was trying to figure something else out code wise , my mind began to wander. I started thinking about a cheap man’s pinball machine. Now this has been an off again on again project of mine for the past few months. But yesterday I thought about how many 3.5 SBCs that I have and what I could do with them. Originally I wanted to take one throw it inside of a desktop pinball machine and have some crazy serial connections going back and forth to control everything. I then found that the SBCs are over kill.

So, yesterday the idea popped in my head again, but more for haha sake, I wanted to see if I could make the LEDS on a keyboard flash using C#. And in doing this I could use the current that would come from the LEDS to power a relay and turn on the Solenoids/Flippers. Just a concept. Nothing really extreme or solid, just a simple proof of concept(I’ve been in to those a lot recently.)

So I coded it out as a Console Window application using 1 C# file and the command line to compile it. (That way I couldn’t lazy my way out and use help files.) Here’s what I have.

using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace popsknot.griz.keyFlasher
{
public class keyFlasher
{

[DllImport("user32.dll")]
static extern ushort GetKeyState(short nVirtKey);

[DllImport("user32.dll")]
static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, int dwExtraInfo);

public const ushort keyDownBit = 0x80;

const int KEYEVENTF_EXTENDEDKEY = 0x1;
const int KEYEVENTF_KEYUP = 0x2;

private static int counter = 10;
private static bool rFlipper = false;
private static bool lFlipper = false;

public static void Main(string[] args)
{
if (Control.IsKeyLocked(Keys.Scroll))
{
keybd_event(0x91, 0x45, KEYEVENTF_EXTENDEDKEY, 0);
keybd_event(0x91, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);

}

if (Control.IsKeyLocked(Keys.NumLock))
{
keybd_event(0x90, 0x45, KEYEVENTF_EXTENDEDKEY, 0);
keybd_event(0x90, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);

}

while (counter !=0)
{
if (IsKeyPressed(Keys.Escape))
{
counter = 0;
}

//Right Flipper
if ((System.Windows.Forms.Control.ModifierKeys & Keys.Control) == Keys.Control)
{
if (!rFlipper)
{
Console.WriteLine("Trigger Right Flipper" + 0x90);
keybd_event(0x91, 0x45, KEYEVENTF_EXTENDEDKEY, 0);
keybd_event(0x91, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
rFlipper = true;
}
}
else
{
if (rFlipper == true)
{
keybd_event(0x91,0x45, KEYEVENTF_EXTENDEDKEY, 0);
keybd_event(0x91, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
rFlipper = false;
}
}

//Left Flipper

if ((System.Windows.Forms.Control.ModifierKeys & Keys.Alt) == Keys.Alt)
{
if (!lFlipper)
{
Console.WriteLine("Trigger Left Flipper" + 0x90);
keybd_event(0x90, 0x45, KEYEVENTF_EXTENDEDKEY, 0);
keybd_event(0x90, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
lFlipper = true;
}
}
else
{
if (lFlipper == true)
{
keybd_event(0x90, 0x45, KEYEVENTF_EXTENDEDKEY, 0);
keybd_event(0x90, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
lFlipper = false;
}
}
}
}

public static bool IsKeyPressed(Keys key)
{
return ((GetKeyState((short)key) & keyDownBit) == keyDownBit);
}
}
}

Also keep in mind that I did about 2 minutes of testing on this on my development machine. That means that there is a chance I may be doing something wrong and it could cause damage to something. So, use at your own risk.

Another day another project

March 26th, 2010

So here I am, I’ve been looking at what I worked on in 2009 and it’s lack of appearances in the toybox. And keep asking myself, “why do I keep neglecting the toybox?”The answer to that is still. I don’t know. I have two things from 2010 that I just… Ah well I’ll talk about them some other time.