Go Down

Topic: Desktop serial read from Arduino in generic C or C++ (Read 1 time) previous topic - next topic

louarnold

Oct 04, 2012, 01:42 am Last Edit: Oct 04, 2012, 01:47 am by louarnold Reason: 1
I use a Code::Blocks IDE for developing Arduino sketches. I wanted to use the same IDE to create a desktop program that reads the USB port to get data sent by the Arduino. Does anyone have a program that works? Even a test program would be great.

I have looked at VBScript that supposedly works, but I don't do VBScript. Needless to say I don't have dotNet or MFC, so ..Wnat else is there?? Win32?

I'm stumped as to how to proceed.

Should the Processing library be used here?

PaulS


louarnold


http://arduino.cc/playground/Main/InterfacingWithSoftware
Lots of ways to talk to the serial port.
Thank you. There is a great deal there, but if you go through it all, you'll see that there is very little that is for Windows , and is in C++, and is very simple, and uses a small amount of code, and is explained, and does not require Visual Studio. I have already written Arduino resident software that sends ASCII data to a desktop via the USB port. The problem is how to write the desktop resident software.

So here are a few questions:
1) I thought Firmata is out of date. Is that true? Does this library useful in a desktop program communicating over the serial port?
2) The examples seem to have code developed in the Ardunio IDE that execute in the desktop under Windows. Is that true? If so, what do I do to make that work?
3) Is the "Processing" library useful for communications over the serial port?

PaulS

Quote
1) I thought Firmata is out of date. Is that true? Does this library useful in a desktop program communicating over the serial port?

It's not out of date. It's simply not being supported (or visibly supported, I should say) for the Arduino. Anyway, the sending application needs to send data in the Firmata format. Is this something you know how to do?

Code: [Select]
2) The examples seem to have code developed in the Ardunio IDE that execute in the desktop under Windows. Is that true? If so, what do I do to make that work?
Which examples are you referring to? Applications developed in the Arduino IDE run on the Arduino, not on the PC.

Quote
3) Is the "Processing" library useful for communications over the serial port?

The Processing application is. It's more than a library.

louarnold

#4
Oct 05, 2012, 02:23 am Last Edit: Oct 05, 2012, 03:27 am by louarnold Reason: 1

Quote
1) I thought Firmata is out of date. Is that true? Does this library useful in a desktop program communicating over the serial port?

It's not out of date. It's simply not being supported (or visibly supported, I should say) for the Arduino. Anyway, the sending application needs to send data in the Firmata format. Is this something you know how to do?

Code: [Select]
2) The examples seem to have code developed in the Ardunio IDE that execute in the desktop under Windows. Is that true? If so, what do I do to make that work?
Which examples are you referring to? Applications developed in the Arduino IDE run on the Arduino, not on the PC.

Quote
3) Is the "Processing" library useful for communications over the serial port?

The Processing application is. It's more than a library.


I'll leave Firmata for now.
The code that confused me: http://www.arduino.cc/playground/interfacing/processing, see Example. The setup fr that code is very similar to software that is downloaded to the Arduino.
On that page, it talks about libraries, but I didn't see a link to getting the "Processing application" (or IDE?). I assume the "import" statements are for that IDE.

And, at last, here: http://arduino.cc/playground/Interfacing/CPPWindows. This is just a class definition but its supposed to have been tested with Code::Blocks and MINGW. I'll let you know. Well, the class compiles under CodeBlocks and MINGW. Would be nice to have an example of use, but the one given is for VC++ 2008 Express.

There is also a class (Google serial_src_zip), but when I try and compile that, it says it can't find "stdafx.h", and I don't know why that happens or how to fix that. I seem to recall that stdafx is for MFC. Its been too long. Is that not true?

Go Up