The test gadget can be flashed to most PlatformIO compatible devices.
examples/hardware/serial_raw_ping_pong.py
1 2 3 4 5 6 7 8 910111213141516171819
importtimefromkevinbotlib.hardware.interfaces.serialimportRawSerialInterface# ! remember to change these settings for your testing environmentgadget=RawSerialInterface(None,"/dev/ttyUSB0",9600)# gadget.open() # * not needed if a port is provided above ^whileTrue:gadget.write(b"ping\n")print("Sent ping, waiting for pong...")whileTrue:line=gadget.readline().decode("utf-8").rstrip()ifline=="pong":print("Got pong")breaktime.sleep(1)
Arduino Nano image modified from an original image by MakeMagazinDE, licensed under CC BY-SA 4.0 (link). ↩