Emulating PS2 keyboard
Video about PS2:
PS2 remote keyboard (wifi+web): https://remysharp.com/2021/04/14/building-a-ps2-remote-keyboard
Project ps2dev: https://github.com/Harvie/ps2dev
Emulating PS2 keyboard
Video about PS2:
PS2 remote keyboard (wifi+web): https://remysharp.com/2021/04/14/building-a-ps2-remote-keyboard
Project ps2dev: https://github.com/Harvie/ps2dev
STATUS
CircuitPython does not support USB Host yet, but the basis API and partial implementation.
The idea is for CircuitPython to rely on TinyUSB, the same way it does for USB Client activities.
Some hardware that run CircuitPython are designed with USB Host in mind such as:
PS2 is a old PC keyboard (and mouse) connector/protocol used prior to USB. It is still available on some PC mother board. The protocol is serial and run at 5V, so it require electronic if your microprocessor is 3V.
Support for CircuitPython was added by user elvis-epx with the PR: adafruit/circuitpython#1893
The process to add PS2 protocol to CircuitPython was documented by the author: https://epxx.co/artigos/howto.html
Here is the CircuitPython documentation: https://docs.circuitpython.org/en/latest/shared-bindings/ps2io/index.html
# SPDX-FileCopyrightText: Copyright (c) 2021 Tim Cocks for Adafruit Industries | |
# | |
# SPDX-License-Identifier: MIT | |
""" | |
`adafruit_st25dv16` | |
================================================================================ | |
CircuitPython driver for the I2C EEPROM of the Adafruit ST25DV16 Breakout | |
from adafruit_magtag.magtag import MagTag | |
from adafruit_progressbar.progressbar import ProgressBar | |
# BELGIUM | |
POPULATION = 11589616 | |
DATA_SOURCE = "https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/vaccinations/country_data/Belgium.csv" | |
magtag = MagTag(url=DATA_SOURCE) | |
magtag.network.connect() |
""" | |
Turn on all the LEDs from each Buzz! controler one after the other. | |
Work with both kind of wired Buzz! controler. | |
Require to install hid library, not an easy task. | |
""" | |
import hid | |
import time |
from keypad import Keys | |
import board | |
import time | |
pins = [board.BUTTON_A, board.BUTTON_B] | |
keys = Keys(pins, value_when_pressed=False, pull=True) | |
while True: | |
if keys.events.overflowed: | |
keys.events.clear() |
# CircuitPython Discord rotating clock emoji (spam). | |
# Type an emoji in Discord... do nothing else, with your ItsiBitsy nrF. | |
# Press the button to replace that emoji by another one every second. | |
import time | |
import board | |
import usb_hid | |
from digitalio import DigitalInOut, Direction | |
from adafruit_hid.keyboard import Keyboard |
### | |
# Dual BLE mouse jiggling: | |
# Advertise a first mouse as "CircuitPython HID1" | |
# Once we have a first connection | |
# Advertise a second mouse as "CircuitPython HID2" | |
# | |
# Once the first mouse is connected the jiggling start. | |
# Mouse1 should do Left-Right movement | |
# Mouse2 (once connected) should do Up-Down movement | |
# |