Sending messages to the board's USB port

I have the 2009 board and it works great. Now i want to send command strings to the board from my computer. Do you have a sample program (hopefully in C) to send it command strings.

My application is that Ive programmed it to run some stepper motors and now i want to tell it how to move the motors from another program on my laptop.

I've tested the code by typing into the Serial Monitor window. Now I need to send messages that are computed by another program.

Thanks,
Tom

I don't have specific examples, but you just need to send the desired strings to the serial port that Arduino is connectd to.

Although it is connected to a USB port, it is a virtual serial port.

You should be able to find lots of examples on how to access the serial port from C on the net.

hmm... I don't have any C serial port examples. You would need a library (i.e. .h and .c files) and the library you use would depend on the operating system. Which OS are you using?

Which OS are you using?

That is irrelevant, what matters is what framework you are using.

Most of the languages like Processing have things like serialPrint(xx) or fprint(xx)

There is an example sketch distributed with Processing for sending data to Arduino. In the Processing File menu, select: Examples/Libraries/Serial/SimpleWrite

try serial monitor :stuck_out_tongue:

try serial monitor

I-Parakeet, re-read the first post, the OP said: "I've tested the code by typing into the Serial Monitor window. Now I need to send messages that are computed by another program."

Mem, thanks for the reply. My menu doesn't break down the way you mentioned. I also tried searching for SimpleWrite in the Arduino directories with no luck. I'll also try to find a simple serial driver on the internet. Way back you could just talk to the serial ports but these days you need to do more stuff like attach to the port using the OS. BTW, I am on windows XP using Visual Studio. That said I still need to use C not C++ or C# for this application.

Tom, SimpleWrite is a Procesing sketch so you find it in the Processing Menu not in the Arduino IDE. The Processing language and IDE are similar to Arduino, but Processing is Java not C. So it may not be suitable for your application

I am on windows XP using Visual Studio.

Getting closer. What sort of "visual studio", as I understand it that is only a development environment. You need to look at the serial write examples in "visual studio" rather than anything here.
When I used Visual Basic there was a simple COM write object. Do you have the same thing?