Nav

How to use the Pi Cap as a USB keyboard

Learn how to use the Pi Cap as a USB keyboard

The Pi Cap is able to simulate keyboard strokes for each of its 12 electrodes. In this tutorial, we are going to show you how to run the code, how to edit it and more. You are going to need to attach a screen to the Pi as the keyboard strokes are going to be simulated on the attached screen. You can still SSH into the Pi to run the code. Also, we recommend having a look at our Terminal tutorial if you have never used the terminal application on your Pi before.

Learn how to use the Terminal application and Pi Cap

How to use the Terminal application and Pi Cap

Learn how to the run Pi Cap script at start-up

How to run Pi Cap script at start-up

Write messages with your Touch Board – or control games - with a HID keyboard!

The Touch Board as an HID keyboard

Step 1

Set up the Pi Cap

If you haven’t set up your Pi Cap then make sure to complete one of our set up tutorials first:

Setting up your Pi Cap on the Raspberry Pi 1, 2 or 3

Setting up your Pi Cap on the Raspberry Pi Zero

Links

Step 2

Connect peripherals

For this tutorial, you need to connect a screen and a mouse to the Pi. The keyboard strokes are going to appear on the screen and the mouse is necessary to open a text editor.

Links

Step 3

Run the code

In order to run the code, open your terminal window. This can either be via SSH or the terminal on your Pi. Then enter “PiCapExamples/Python/picap-keyboard-py/run” and hit enter to run the code. If you now open a text editor on your Raspberry Pi with the mouse, you can touch electrodes 5 to 9 to type “HELLO”.

Links

Step 4

Modify the code

If you want to want to change which keys are pressed with which electrodes, then open the code with “nano PiCapExamples/Python/picap-keyboard-py/keyboard.py”. Between line 42 and 53, you can see which electrodes correspond to which key. Here you can change the keyboard stroke to your choice.

Links

Step 5

Further steps

With the HID keyboard simulation, you can now play games and use the electrodes to press the arrow keys!

We’d love to see your creations, so feel free to send us your images and videos either at info@bareconductive.com or via Twitter or Instagram.

At the time of writing, we don’t have the keyboard simulation code written for Node or C++. Let us know at info@bareconductive.com if you require the code written in C++ and Node.

Links

Suggested Tutorials

Learn how to use the Terminal application and Pi Cap

How to use the Terminal application and Pi Cap

Learn how to the run Pi Cap script at start-up

How to run Pi Cap script at start-up

Write messages with your Touch Board – or control games - with a HID keyboard!

The Touch Board as an HID keyboard

Categories

Bare Conductive

Instructions

Pi Cap

Date Posted

2018/11/16

Rating

0.00 avg. rating (0% score) - 0 votes