<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#">
<link rel="alternate" type="text/html" href="https://gamma.unpythonic.net/"/>

<title>Jeff Epler's blog</title>
<modified>2021-08-18T19:03:43Z</modified>
<tagline>Photos, electronics, cnc, and more</tagline>
<author><name>Jeff Epler</name><email>jepler@unpythonic.net</email></author>
<entry>
<title>Using Adafruit Macropad as LinuxCNC Control Pendant</title>
<issued>2021-08-18T19:03:43Z</issued>
<modified>2021-08-18T19:03:43Z</modified>
<id>https://gamma.unpythonic.net/01629313423</id>
<link rel="alternate" type="text/html" href="https://gamma.unpythonic.net/01629313423"/>
<content type="text/html" mode="escaped">
&lt;b&gt;Update, 2021-09-25&lt;/b&gt;: For compatibility with CircuitPython 7.0.0

&lt;p&gt;&lt;img src=&quot;https://media.unpythonic.net/emergent-files/01629313423/PXL_20210818_191419458.jpg&quot;&gt;


&lt;p&gt;&lt;br&gt;CircuitPython recently gained the power to have custom USB descriptors.
With these, we can define a USB HID device that will work with LinuxCNC's
hal_input.

&lt;p&gt;For instance, the &lt;a href=&quot;https://www.adafruit.com/product/5128&quot;&gt;Adafruit
Macropad&lt;/a&gt; has a (very coarse, just 20 detents/revolution) encoder, 12 keyswitch
positions, and an OLED screen.

&lt;p&gt;The two pieces of software below, when placed in the CIRCUITPY drive as boot.py
and code.py configure it for use with hal_input, using a halcmd line similar to
&lt;tt&gt;loadusr -W hal_input Macropad&lt;/tt&gt;.  I haven't actually done the
work of hooking it all the way up to Touchy yet, but it causes all the buttons
&amp;amp; the encoder to appear in &lt;tt&gt;halcmd show pin&lt;/tt&gt;.

&lt;p&gt;This is just the device I picked first; there's nothing to prevent you from
hooking up more exotic things like voltage/temperature monitors through added
CircuitPython code.  Addition of output reports for status indicators is left
for the motivated reader.</content>
</entry>
</feed>
