The test gadget can be flashed to most PlatformIO compatible devices.
examples/hardware/serial_kv_controller.py
1 2 3 4 5 6 7 8 91011121314151617181920212223
importtimefromkevinbotlib.hardware.controllers.keyvalueimportRawKeyValueSerialControllerfromkevinbotlib.hardware.interfaces.serialimportRawSerialInterface# ! remember to change these settings for your testing environmentinterface=RawSerialInterface(None,"/dev/ttyUSB0",9600,timeout=1)# a timeout is useful to not stall at `controller.read_next()`controller=RawKeyValueSerialController(interface,b"=",b"\n")whileTrue:print("Sending data")controller.write(b"test",b"1")pair=controller.read()ifpair:print("Got data:",pair)else:print("Serial interface timeout")time.sleep(1)
Arduino Nano image modified from an original image by MakeMagazinDE, licensed under CC BY-SA 4.0 (link). ↩