Go Down

Topic: Sending Signal to Arduino from Computer (Read 1 time) previous topic - next topic


So my project is a robot that drives around, has an arm to pick things up, and uses a webcam for vision tracking, all autonomously. A laptop will sit on the robot to process the information from the webcam and use that information to decide where to drive and when to pick things up. The code to drive the robot via vision is set, it sends commands via USB directly to an expensive motor controller using C++ (a code that I didn't write).
The motors for the arm will run on different motor controllers that will be controlled by the Arduino. The Arduino code runs continuously as soon as I plug it into the laptop. When certain conditions are met, the C++ code will change the value of a single variable. I need the Arduino to know when this variable changes value so that it runs the motors for the arm in response. Driving the motors is easy, getting the Arduino to know when to drive the motors based on the webcam and laptop is the part I don't know.


Have you written any code to receive serial data in your Arduino ?

If not I suggest you try out the examples in serial input basics.

If you have Arduino code that is not working please post it if you want help with it. And use the code button </>
Code: [Select]
so it looks like this

I am assuming that you know how to get your PC to figure out when it needs to send something to the Arduino.

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

Go Up