All Projects → Harvie → ps2dev

Harvie / ps2dev

Licence: MIT license
Arduino library to emulate PS2 keyboard/mouse

Programming Languages

C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to ps2dev

ArduinoJoystickWithFFBLibrary
An Arduino Joystick Library With Force Feedback Feature
Stars: ✭ 128 (+91.04%)
Mutual labels:  arduino-library
Queue
Queue handling library (designed on Arduino)
Stars: ✭ 73 (+8.96%)
Mutual labels:  arduino-library
arduino-cereal
Drop-in replacement for Arduino's serial monitor with variable watches.
Stars: ✭ 45 (-32.84%)
Mutual labels:  arduino-library
arduino-primo-tutorials
Here some tutorials to explain and show how to make use of the new features of the Arduino Primo and Arduino Primo Core, such as Wifi, BLE, NFC, InfraRed and various sensors. Hope you can find this helpful to create amazing stuff, save the planet or make a cool project to look smart at the dinning table with your uncles.
Stars: ✭ 12 (-82.09%)
Mutual labels:  arduino-library
TLE5012-Magnetic-Angle-Sensor
This repository includes an library for Arduino for the TLE5012 Magnetic Angle Sensor with SSC interface.
Stars: ✭ 37 (-44.78%)
Mutual labels:  arduino-library
qp-arduino
QP real-time embedded frameworks/RTOS for Arduino (AVR and SAM)
Stars: ✭ 37 (-44.78%)
Mutual labels:  arduino-library
Arduino-DCF77
Efficient and complete DCF77 library for Arduino
Stars: ✭ 25 (-62.69%)
Mutual labels:  arduino-library
DCCpp
This is the library version of DCC++ for Arduino, to control railroading DCC devices.
Stars: ✭ 18 (-73.13%)
Mutual labels:  arduino-library
SparkFun CCS811 Arduino Library
A library to drive the AMS CCS811 air quality sensor
Stars: ✭ 38 (-43.28%)
Mutual labels:  arduino-library
SparkFun SerLCD Arduino Library
A library to seamlessly control the SparkFun SerLCD over I2C, SPI, and Serial.
Stars: ✭ 18 (-73.13%)
Mutual labels:  arduino-library
CS5490
Arduino / ESP Library for Communication with the Cirrus Logic CS5490 Chip
Stars: ✭ 17 (-74.63%)
Mutual labels:  arduino-library
ESP32BleAdvertise
Simple library for BLE advertise using ESP32 in Arduino
Stars: ✭ 39 (-41.79%)
Mutual labels:  arduino-library
SerialTransfer
Arduino library to transfer dynamic, packetized data fast and reliably via Serial, I2C, or SPI
Stars: ✭ 273 (+307.46%)
Mutual labels:  arduino-library
MPU6050 light
Lightweight, fast and simple library to communicate with the MPU6050
Stars: ✭ 73 (+8.96%)
Mutual labels:  arduino-library
library-registry
Arduino Library Manager list
Stars: ✭ 95 (+41.79%)
Mutual labels:  arduino-library
Adafruit SSD1305
OLEDs with SSD1305
Stars: ✭ 20 (-70.15%)
Mutual labels:  arduino-library
Adafruit CCS811
Arduino driver for CCS811 digital gas sensor
Stars: ✭ 60 (-10.45%)
Mutual labels:  arduino-library
Arduino-Shell
RPN Postscript/Forth Command Shell for Arduino
Stars: ✭ 19 (-71.64%)
Mutual labels:  arduino-library
ServoTimer2
ServoTimer2 is a simple library for Arduino 1.x that does not use Timer1 in case of a conflict.
Stars: ✭ 29 (-56.72%)
Mutual labels:  arduino-library
PMserial
Arduino library for PM sensors with serial interface
Stars: ✭ 41 (-38.81%)
Mutual labels:  arduino-library

Arduino ps2dev library

This library allows arduino to emulate ps2 keyboard and/or mouse, so you can implement your own ps2 keyboard or whatever...

I want to improve this, provide better documentation and arduino library manager package for it...

Originaly from:

Further reading:

Electrical connections

The following is an easy way to get started:

  • Take a PS/2 mouse apart without cutting any cables.
  • Desolder the socket that the PS/2 cable is connected to.
  • Use a multimeter to find the pinout of the socket.
  • Solder the socket to an Arduino proto shield. If the pitch does not match you can also consider simply using mounting the socket vertically with super glue and soldering wires directly to the socket.
  • Solder three wires on the Arduino proto shield as follows.
Arduino pin PS/2 pin example color (on a HP mouse)
2 DATA brown
3 CLK orange
GND GND green

There is no need to connect the VCC. If you want to use different pins on the Arduino side you can just adjust the call to the PS2dev constructor. In theory this should allow you to emulate multiple keyboard on one Arduino but this has not been tested.

Notes

  • If you are implementing keyboard you should read the commands from computer quite often. I don't know how often, but 1 second is not enough. You will miss stuff like num/caps/scroll LED changes and maybe even more important stuff needed for proper ps2 protocol initialisation.
  • Calling keyboard_handle(...); each 10ms should be enough...
  • Serial debug is not intended to be enabled in production code. Use it only during development. Otherwise it might mess up the protocol timing.

TODO

  • Move leds variable to the ps2dev class
  • Add mode, where attachInterrupt() will be used to watch CLK pin instead of need to constantly poll it using available() or keyboard_handle()
  • Add mouse protocol handling directly to library
  • Check against Arduino API style guide: https://www.arduino.cc/en/Reference/APIStyleGuide
  • Check why there are occasional issues with PS2Keyboard library https://github.com/PaulStoffregen/PS2Keyboard
    • I've been using this to send keystrokes between two arduinos (from ps2dev to PS2Keyboard) and there are some issues (missed keystrokes). So i had to use SoftwareSerial.h instead, ditching the PS2 compatibility. We need to debug this...

Special thanks

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].