Sending variable to Arduino from RPi (Serial Communication)

Hello,

I have been working on this serial communication project for a while. I got the Arduino to send data perfectly to the RPi to be graphed in a Python GUI. However, now I have a button on the GUI to send information back. There are no error messages from the GUI, so I wanted to see if it was my Arduino script.

I have tried a couple things, but basically a 3 to 4 digit number will be sent to the Arduino, and I would like for it to start gathering data after the "byte" is sent.

My apologies for the code (it is probably not pretty). I am a bit better at Python at the moment. I am just altering another kind person's code a bit at a time.

Code attached.

I appreciate any comments or suggested pages. :slight_smile:

Kaylee

Serial_Python.ino (3.2 KB)

Have a look at the examples in Serial Input Basics - simple reliable ways to receive data. There is also a parse example.

Unless you really need the extra performance it will be much easier to debug code if you send the data in human-readable form rather than as binary data.

...R