CA
  
You are currently viewing the Canada version of the site.
Would you like to switch to your local site?
7 MIN READ TIME

CIRCUITPY THON

Build your own bespoke USB device

Les Pounder uses his snake charming skills again to prove how easy it is to make USB devices with Python and the cheapest of Pis.

Credit: https://circuitpython.org

OUR EXPERT

Les Pounder is associate editor at Tom’s Hardware and a freelance maker for hire. He blogs about his adventures and projects at http://bigl.es.

YOU NEED

Raspberry Pi Pico

A rotary encoder

5x M2M wires

Half breadboard

Code: https:// github.com/ lesp/LXF-Circuit Python_ Scroller/ archive / refs/heads / main.zip

Building a USB-powered interface device is hard, right? Not really. Creating USB devices with microcontrollers has been possible for years. We remember using an Arduino Micro to emulate keystrokes for an arcade cabinet build.

Over the years, it has become much easier to emulate many different USB devices, and with the Raspberry Pi Pico and a little CircuitPython code, we can fool our OS into thinking a Pico is both a mouse and a keyboard.

In this project, we will create a device that will scroll long pages using a rotary encoder. The same encoder will also be programmed to act as a push button, taking a screenshot when pressed. This project is a useful introduction to creating alternative user inputs – for example, for use by people with accessibility issues.

Too easy

This build is simple so we can focus on using the rotary encoder, rather than building a complex circuit. Typical rotary encoders have five pins. The three pins are for the encoder, the centre one being GND, while the other two register increments or decrements as we turn. The other two pins are for the push button at the base of the encoder. Pushing down on the encoder will push a button. For wiring instructions, see the high-res diagram available via the download (see URL on left).

Unlock this article and much more with
You can enjoy:
Enjoy this edition in full
Instant access to 600+ titles
Thousands of back issues
No contract or commitment
Try for $1.39
SUBSCRIBE NOW
30 day trial, then just $13.99 / month. Cancel anytime. New subscribers only.


Learn more
Pocketmags Plus
Pocketmags Plus

This article is from...


View Issues
Linux Format
January 2023
VIEW IN STORE

Other Articles in this Issue


WELCOME
MEET THE TEAM
This issue, we’re helping people escape Windows again and use Elementary OS instead. What would you suggest a newbie should try out in the open source world?
It just works!
It’s a phrase I’ve seen used steadily for
REGULARS AT A GLANCE
Newsdesk
THIS ISSUE: Funding programmes Google’s secure OS Godot goes independent Torvalds interview Arm case aids RISC-V
Kernel Watch
Jon Masters keeps an eye out for all the latest happenings in the Linux kernel, so you don’t have to.
ONGOING DEVELOPMENT
The Asahi Linux project posted a lengthy update
Answers
Got a burning question about open source or the kernel? Whatever your level, email it to answers@linuxformat.com
Mailserver
Hmm, MX Linux has been the number one
A Photo Tool Libre
Version: 1.0.4-3 Web: https://github.com/ aphototool/A-Photo-Tool-Libre Many desktop distributions
Shutter Encoder
MULTIMEDIA CONVERTER
Passy
OFFLINE PASSWORD MANAGER
Open-Typer
TYPING TUTOR
Qtexttospeech
TEXT TO SPEECH
Thorium
WEB BROWSER
Ásbrú Connection Manager
SESSION MANAGER
ET: Legacy
FIRST-PERSON SHOOTER
Cro-Mag Rally
RACING GAME
Nvtop
GPU PROCESS MONITOR
Stretchly
BREAK REMINDER
LINUX FORMAT
The #1 open source mag Future Publishing Limited,
REVIEWS
Samsung 990 Pro 2TB
Return of the king? Yes, Jeremy Laird is back.
Phrozen Sonic 8K
Bigger prints, finer details, Linux support – is
AntiX-22
Nate Drake discovers there’s lots to love about the fast, lightweight and stable operating system that is AntiX.
Voyager Live 22.10
Nate Drake explores the glorious union of Gnome and Xfce in a single OS. You’ll never look at your desktop the same way again.
Ubuntu Unity 22.10
Nate Drake takes you on a trip down memory lane as the Unity Desktop makes its official comeback to Ubuntu.
ROUNDUP
ROUNDUP
Trilium 0.56 CherryTree 0.99 Zim 0.75 Joplin 2.8.8 QOwnNotes 22.10.3
ESCAPE WINDOWS
Looking for a practical alternative to Windows? Nick Peers reveals how to set up and use the extremely user-friendly Elementary OS.
You’ve made your choice – it’s time to install Linux alongside Windows.
Install Elementary OS alongside Windows
Take the desktop tour
The big selling point of Elementary OS is its desktop – here’s what you need to know.
Installing new apps
Finding and installing apps in Elementary OS is easy, but you’ll need more than the default app store provided.
Take a deeper dive
Your new operating system is up and running, and your journey into Linux has begun. Here’s where to focus your efforts next.
Pi USER
TWEET DREAMS ARE MADE OF THIS
Les Pounder is an editor at Tom’s Hardware
Pis to be fully stocked by autumn 2023
Eben Upton tells us we can expect shelves to be groaning with Raspberry Pis again later in 2023.
3, 2, 1, Make!
More projects!
EsPiFF
A new microcontroller.
PiKISS v1.10.0
Les Pounder is getting to an age where things need to be simple, so when someone said “Keep It Simple, Stupid”, he took no offence.
Design and build your dream Pi robot
In his latest series, Les Pounder explains how to plan, design and build your very own Raspberry Pi robot from the basics up.
Monitor and graph your system metrics
Graphs make Matt Holder happy, so he spent his weekend storing system statistics in a database and pumping out graphs so you can, too!
The Audacity of it
We chat with Martin Keary about the new features of Audacity, managing a community and the pitfalls of telemetry.
TUTORIALS
Improve your typing
Years ago, when Shashank Sharma had more hair on his scalp than cheeks, he decided to master touch-typing. With these tools, so can you.
Take full control of your passwords
Nick Peers reveals how to get started with Buttercup, a password manager that puts you firmly in control of your sensitive data.
ReactOS: the open source Windows
Open source OS
Create videos from time-lapse photos
Time-lapse videos
Explore a box full of distributions
Containers
Get started photo editing with GIMP
Photo editing
IN DEPTH
Open source RAW photography
Linux offers all the pro-level tools you could possibly need for better photos. Karsten Günther is your top-tips guide.
CODING ACADEMY
Using eBPF to monitor filesystems
Mihalis Tsoukalos explains how to use eBPF to track filesystems.
Code an admin back-end in Django
Continuing with our magazine cataloguing application, Matt Holder explains how to create admin controls and basic view functions
Chat
X
Pocketmags Support