Let's Make Robots!

serial protocol for motor control with arduino and cpp

Hi all,

I need to interface my arduino board and my laptop to communicate together. I want some messages going from the arduino to the pc, and other going from the pc to arduino. Does anyone have a suggestion on how to implement a protocol?

example: from the arduino i want to send the position of N motors and I need to read them on the pc using cpp

example2: the pc sends a message to the arduino with the reference position of motor X.

How should I implement functions that allow this exchange of information? Anyone have suggestion or tutorials or code?

thanks :)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

You are looking for UART serial communication.