How can I turn a Keyboard's buttons into switches? (Embedded Sys)

  • Thread starter Thread starter Bizantium
  • Start date Start date
  • Tags Tags
    Switches
AI Thread Summary
To convert a PS/2 keyboard into a switch for an arcade game, the focus is on tapping into the keyboard's data and clock signals rather than using a traditional joystick. The project involves using a decoder to interpret scan codes, as each key generates a unique signal that can be repurposed for game controls. While Atmel chips are suggested, there is uncertainty about the best method for interfacing and programming the keyboard for embedded systems. It's noted that all PC keyboards share the same scan codes for basic keys, simplifying the process across different brands. Overall, the discussion emphasizes the need for an efficient interface to manage these signals without extensive rewiring.
Bizantium
Messages
2
Reaction score
0
I'm working on a project in my job, but being only a student in CE and Comp. Sci. I'm limited in knowledge.

I'm looking for a way to communicate with an arcade game, with a standard PS/2 Keyboard. Eliminating the standard joystick and buttons and using a keyboard instead. What would be the best and efficient way into tapping into PS/2 data and clock signals and get them to act as a switch? Where " W " key is UP, S is down, etc etc.

Basically I'm looking for the complete opposite of a Keyboard Encoder, which I imagine would be a Decoder. I've seen some Atmel chips that will do the job but I'm just not sure if there's another more easier way? As of now, what I do is rip the keyboard open and rewire it. This method is time consuming and I know there's something like a Decoder where the ASCII signals can be tapped into with much ease, and I can reprogram them to have them act as switches..

Any insight?
 
Computer science news on Phys.org
PC keyboards generate scan codes, you can start with this wiki article:

http://en.wikipedia.org/wiki/Scancode

I'm not sure what you'd need to provide an interface to power the keyboard and received the scan codes.
 
Yeah the interface is mainly what I'm looking for in this case. I know each key has their own code, and the keyboards vary with their signals and it all gets interpreted by the computer ( our home PC ). But when It comes to embedded systems I can see that things get more complex.

If I am not mistaking each keyboard would have to be programmed differently in this sense if I were to make each key act as a switch. An IBM keyboard would give it's signals from key A, and a Logitech Keyboard ( both PS/2 ) would give off it's own unique signal for letter A?

Or if there's anybody here that can confirm to me logically or by experience that an MCU can can read these signals without having to actually #define them and layout the entire matrix? If so, can a simple If() statement be used to ground a specific unique port for different characters?
 
Bizantium said:
An IBM keyboard would give it's signals from key A, and a Logitech Keyboard ( both PS/2 ) would give off it's own unique signal for letter A?
All PC keyboards use the same scancodes, although some have have more keys and more scan codes than other keyboards. The scancodes for w a s d would be the same for any PC keyboard. Link from the wiki article about interfacing with a PC keyboard:

http://www.beyondlogic.org/keyboard/keybrd.htm
 
Last edited:
In my discussions elsewhere, I've noticed a lot of disagreement regarding AI. A question that comes up is, "Is AI hype?" Unfortunately, when this question is asked, the one asking, as far as I can tell, may mean one of three things which can lead to lots of confusion. I'll list them out now for clarity. 1. Can AI do everything a human can do and how close are we to that? 2. Are corporations and governments using the promise of AI to gain more power for themselves? 3. Are AI and transhumans...
Thread 'ChatGPT Examples, Good and Bad'
I've been experimenting with ChatGPT. Some results are good, some very very bad. I think examples can help expose the properties of this AI. Maybe you can post some of your favorite examples and tell us what they reveal about the properties of this AI. (I had problems with copy/paste of text and formatting, so I'm posting my examples as screen shots. That is a promising start. :smile: But then I provided values V=1, R1=1, R2=2, R3=3 and asked for the value of I. At first, it said...
Back
Top