[simpits-tech] Small CRTs (Was: Just a quick update.........)

Cris Harrison phoenixcomm at gmail.com
Wed Apr 11 09:49:04 PDT 2012


On 4/10/2012 10:57 PM, dabigboy at cox.net wrote:
> Thanks for the link, looks interesting. Actually the original CRT tube probably still works, I just have no idea how to power or drive it, so I went the "easy" (HAH!) route. I would love to run the original 3" CRT, but I'm afraid such a feat is far beyond my meager electronics skills.
>
> Matt
> _______________________________________________
> Simpits-tech mailing list
> Simpits-tech at simpits.org
> http://www.simpits.org/mailman/listinfo/simpits-tech
> To unsubscribe, please see the instructions at the bottom of the above page.  Thanks!
>
Matt
I saw the working LCD nice.. for your keyboard dont re-invent the 
wheel.. a ps2 keyboard (downer) with the cable then a ps2 extension 
cable for your socket or rip one off a old dead motherboard, works 
really well. Check out my blog: 
http://phoenixcomm.wordpress.com/category/ps2-keybaord/
there is a nice step by step tutorial here: 
http://www.instructables.com/id/Hacking-a-USB-Keyboard/ 
<http://www.instructables.com/id/Hacking-a-USB-Keyboard/>
one note ps2 keyboard is a snap if you use usb you will need a USB 
shield, because you cant use the usb that goes to your host (wont work)
then write a little lookup table and assign the keys: you have the full 
alpha A-Z  (but there shifted).
so use un-shifted first something like this:

/keyboardscanner(){
enum skeys { MSG, ALPHA, CLR, ENTER }
//then the rest is a snap.. just use alpha keys but your going to have 
to change them a little
raw = getchar();     // get first char
switch( raw ) {
case MSG: //do something
case ALPHA: {
      alpha_flag = 1; //shifts keybord for one char.
      raw = getchar();
     decodedchar = decoder( raw, alpha_flag )
     // send off the char
     alpha_flag = 0; // reset flag }
case CLR: // press once: clear last char  or press twice: clear msg.
case ENTER: // does what it says.. no code.
default: {
     alpha_flag = 0; //make sure that the flag is reset
      decodedchar = decoder( raw, alpha_flag )
     // send off the char
    }}}

char decoder( char raw, int alpha_flag ){
// build a 2 dim lookup table (array)  ie.. something in.. something 
else out.. LOL
char keys[4][28]; //to make it simple do it in two passes..
keys[0] = { unshifted keys}
keys[1] = { shifted keys }
keys[2] = {outputed un-shifted keys }
keys[3] = {outputed shifted keys }

  for( int n = 0; n <  29; n++ ){
     if( raw = keys[ alpha_flag][n] ) {
         return  keys[ alpha_flag + 2 ][n];
}
// error recovery ?
return -1;
}
/
BTW there is a ps2 keyboard libary.. in the playground:
http://www.arduino.cc/playground/Main/PS2Keyboard
I have mine hooked up on a prototype shield (btw or maybe a gotcha?
the cheep proto shields on ebay ARE NOT STACKABLE!! beware!!!!

hopes this all helps just a little

Cris H.
phoenixcomm.wordpress.com
<http://www.instructables.com/id/Hacking-a-USB-Keyboard/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.simpits.org/pipermail/simpits-tech/attachments/20120411/0605222f/attachment.html 


More information about the Simpits-tech mailing list