A 6-pin mini-DIN connector can be used to connect a PS/2 PC-style keyboard directly to the PICAXE chip.
PS2 Keyboard
Schematic
PCB
Read a keyboard key press code
This program will receive key presses from a PS/2 keyboard and display the key press code in the 'b1' variable.
- Code Example:
-
main: kbin b1 ; Wait for a key press code debug ; Display the value goto main ; Repeat
Copy Code Submit an Example
Read a keyboard character
This program will receive key presses from a PS/2 keyboard and display the character in the 'b1' variable. Note that this example will only work with PICAXE-M2 chips which support the 'kbin #variable' command.
- Code Example:
-
main: kbin #b1 ; Wait for a key press debug ; Display the character goto main ; Repeat
Copy Code Submit an Example
Create Module
A PS/2 keyboard can be connected using two generic terminal block create modules to carry the data and clock signals required for the keyboard.
Bill of Materials
Description | Code | Qty | |
---|---|---|---|
6-pin mini-DIN socket | ? | 1 | Buy Now |
4k7 resistor (pack 100) | RES4K7 | 1 | Buy Now |
Simulation
Submit Your Own Code!
You must be logged in to submit code examples. Login now.
Share