Dev Kit Weekly: Adafruit PyRuler
February 10, 2023
The PyRuler is a fully featured microcontroller board from Adafruit that doubles as a six-inch-long PCB reference ruler. The board also includes four programmable capacitive touch buttons with corresponding LEDs that you can use to create anything from a Simon game to panic buttons for video calls.
On one end of the ruler, there’s an embedded Adafruit Trinket M0, a development board that’s built around a 48MHz ARM® Cortex®-M0+ based ATSAMD21E18 microcontroller from Microchip. Additionally, the MCU itself offers 256KB of flash memory alongside 32KB of SRAM.
The PyRuler receives power via the USB connector on the Trinket M0 side of the board and uses that same USB port to connect to your computer for immediate, out-of-the-box use. The ruler also includes five GPIO header pins independent from the USB and capacitive touch buttons that can be used for any purpose your engineering heart desires, as well as three ADCs, a DAC, and three extra captouch sensors.
As you may have inferred from the name, the PyRuler utilizes the Python programming language — more specifically, CircuitPython, which comes pre-integrated on the board and can be used on any operating system with or without an Arduino IDE. CircuitPython was designed specifically for use on microcontroller boards, especially low-cost ones like this, to keep the use of external resources at a minimum so you can maintain quick, simple project development.
Upon connecting the PyRuler to your PC, you’ll see a small disk drive appear containing a “code.py” file that you can open and edit (using Python) in whatever text editor you prefer to kickstart your project. As a default, the first time you open the code.py file and set the Keyboard mode to “True,” your PyRuler capacitive touch buttons will then exist as a shortcut keyboard for the Omega, Mu, and Pi symbols laid out on each button.
Since any code you write or edit lives directly on the PyRuler disk drive, there’s no need for extra software installation, compilers, or IDEs; and when the device is unplugged, your code stays right where you left it until the next time you plug in and edit.
You can program your PyRuler buttons to do just about anything, within reason. One creator decided to make panic buttons for different video call apps like Zoom and Skype that would turn off their mic and camera. Another decided to take a slightly less frazzling approach and made a Simon game, like back in the good ole days when kids still touched grass sometimes. Of course, there are tutorials and example code available on Adafruit’s website for both projects and more. The world is truly your oyster.
If you’re as excited as I am to have not only custom buttons at your fingertips, but also a PCB reference ruler, because we can never have too many of those lying around, you’re in luck. You can purchase your own PyRuler from Adafruit for just $11.95. Of course, if you’re in a gambling mood, you can also enter this week’s raffle, linked below, for a chance to win a PyRuler for free — we’ll even pay the shipping. Good luck!