<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[AtomS3U USB otg.]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I have the AtomS3U, and have a key module that I can attach to it.</p>
<p dir="auto">I have been playing around with UIFlow2 to get a bit a feel of this thing, an managed to do things like change the led colour when the key is pressed, making the led cycle colors etc...</p>
<p dir="auto">What I however would like to do is have the AtomS3U emulate a keyboard. It supports usb OTG, so that should be supported. I want to try something simple first: Press the button and output some character to the connected PC.</p>
<p dir="auto">I have not found information on how to do this with UIFlow2. Would this need me diving in to micropython or arduino?</p>
]]></description><link>https://community.m5stack.com/topic/7987/atoms3u-usb-otg</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 23:04:41 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/7987.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 02 Jan 2026 15:34:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to AtomS3U USB otg. on Sat, 03 Jan 2026 17:20:01 GMT]]></title><description><![CDATA[<p dir="auto">I tried the following code:</p>
<pre><code>import os, sys, io
import M5
from M5 import *
from unit import KeyUnit
from usb.device.keyboard import Keyboard 
from usb.device.hid import KeyCode



keyboard = None
key_0 = None


def key_0_wasClicked_event(state):
  global keyboard, key_0
  keyboard.set_keys(KeyCode.A, 0, 0, 0, 0, 0)


def setup():
  global keyboard, key_0

  M5.begin()
  keyboard = Keyboard()
  key_0 = KeyUnit((1, 2))
  key_0.setCallback(type=key_0.CB_TYPE.WAS_CLICKED, cb=key_0_wasClicked_event)


def loop():
  global keyboard, key_0
  M5.update()
  key_0.tick(None)


if __name__ == '__main__':
  try:
    setup()
    while True:
      loop()
  except (Exception, KeyboardInterrupt) as e:
    try:
      from utility import print_error_msg
      print_error_msg(e)
    except ImportError:
      print("please update to latest firmware")
</code></pre>
<p dir="auto">And I got the following error:</p>
<pre><code>Traceback (most recent call last):
  File "main.py", line 5, in &lt;module&gt;
ImportError: no module named 'usb'
</code></pre>
<p dir="auto">So the usb module is not present in the firmware.</p>
<ul>
<li>Is that on purpose, or is this a bug?</li>
<li>Is there a way to add the library?</li>
</ul>
]]></description><link>https://community.m5stack.com/post/30404</link><guid isPermaLink="true">https://community.m5stack.com/post/30404</guid><dc:creator><![CDATA[Krist]]></dc:creator><pubDate>Sat, 03 Jan 2026 17:20:01 GMT</pubDate></item></channel></rss>