Arduino_python_communication
Python libraries you need to pre-install
How to use this tool
Initial setup (python side)
On your python file, you need to import everything from the comms_wrapper.py
file. This can be done by from PATH TO FILE import *
, or in a more hacky way, copying the file to your directory of your python file and with the command from comms_wrapper import *
.
The way to use the functions are currently most easilly followed by looking at the example in comms_wrapper_example.py
.
Initial setup (arduino side)
Unfortunatley the way this is currently designed is to have pyCommsLib.cpp
and pyCommsLib.h
inside the same folder as your arduino .ino file. These two files can be found under pyComms/
.
Once you have the two files, when you open your main .ino file through the arduino ide, you should see two new tabs with the .cpp and .h files. This mean you have included the files correctly.
On the main .ino file, you can simply write #include "pyCommsLib.h"
at the top which will make the functions available. There are variables you will need to define and specific ways to call the send/recive functions but this is currently most easily followed by looking at the example in pyComms/pyComms.ino
.