Is there a way to read from a device (Arduino) on a serial port?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By evglabs

I’m just picking up Godot, and was wondering if I can connect to and receive data from a serial port?

Desktop and Android, both would be great. But desktop is the most important.

Thanks!

:bust_in_silhouette: Reply From: rolfpancake

As far as I know there is no implementation of a SerialPort in Godot yet.

Arduino has capabilities for working with C# and Python. There are also some helpful modules like monos SystemIOPorts and pythons pySerial. You could try to get these things running with the Mono compatible version of Godot 3 or the experimental Python bindings.

It could be an interesting thing to add - at least as an external module. I’m not sure if this could be implemented with the help of GDNative (for an introduction see here or here).

If you want to discuss that idea and the best way of implementing it you could talk to the devs at freenode. Or just create a feature proposal as a github issue.