A godot extension support serial port communication.
If want build it as a
module
, switch to themodule
branch.
- Clone and build the plugin.
git clone -b plugin https://github.com/matrixant/serial_port.git --recursive
cd serial_port
scons --sconstruct=gdextension_build/SConstruct target=template_debug
The plugin things will be build to
gdextension_build/example/addons/serialport
directory.
-
The
SerialPort
class will add to godot. You can new a SerialPort object and set it's 'port', 'baudrate', 'bytesize' and so on. Then open it and communicate with your serial device. -
There is an example in serial_port_example repo.