Go Down

Topic: Demo sending binary data from PC to Arduino (Read 6660 times) previous topic - next topic

Robin2

I needed to figure out how to send binary data from my PC to an Arduino for a project to control 3 stepper motors. I thought the demo code might be of interest to Forum users.

The attached Python code sends 5 numbers to the Arduino - in Arduino terms they are an UNSIGNED LONG, 3 INTs and a BYTE.

In the demo the Arduino just sends the numbers back to the Python script to show they were properly received.

The Arduino code uses a STRUCT and a UNION to simplify the receipt and usage of the data from the PC.

The Python code as some similarities with the demo here.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Robin2

Two or three hours spent thinking and reading documentation solves most programming problems.

ggghhy

Hi,

Your every link/post is like a good book to me and many.

Thanks a lot. Keep up the good work!


Cheers.

Go Up