Go Down

Topic: Multi-channle data plot/streaming/graphing thing (Read 5560 times) previous topic - next topic

zitron

Nov 27, 2011, 06:16 pm Last Edit: Jan 17, 2012, 02:54 pm by zitron Reason: 1
Hi guys,

I needed a thing to graph data sent from arduino for my UAV thing, so I put together a program in C# using the excellent ZedGraph graphing libraries.

It allows you to graph upto 10 different channels on one graph (limited only because I couldn't come up with more line colours), and you can change how many samples you want to store in the graph. You can zoom in to the graph, save a picture n'stuff.



It is not super fast, i.e. not meant to be an oscilloscope, but 100Hz is not a problem.


Here's a link to the download: https://sites.google.com/site/iluvtocnc/DataPlot3.zip

Here's a test sketch:

Code: [Select]
void setup() {
  // initialize the serial communication:
  Serial.begin(9600);
}

void loop() {
  Serial.print(analogRead(A0));
  Serial.print(',');
  Serial.print(analogRead(A1));
  Serial.print(',');
  Serial.print(analogRead(A2));
  Serial.print(',');
  Serial.print(analogRead(A3));
  Serial.print(',');
  Serial.print(analogRead(A4));
  Serial.print(',');
  Serial.println(analogRead(A5));
  delay(10);
}


I apologize in advance for any crashes from bugs, the user inputs have zero error checking, since this was a Sunday afternoon job. This is a .net program, so you may need to have .net framework to get it working. I have only tested this on Win 7.

-Z-

I have a lot of people ask me for the code, it's here!!!! ############################
I have posted in the source code here: http://arduino.cc/forum/index.php/topic,80466.0.html

terryking228

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

cengav4r

#2
Jul 01, 2013, 01:53 pm Last Edit: Jul 01, 2013, 01:55 pm by cengav4r Reason: 1
Hi,
I have some questions about it. If system has 5 input and If you send to PC 5 different data over serial simultaneously. How didnt you mixed data which comes from arduino,in C#?
How do u split the data which is comes from arduino, in C#?
(My idea is u must order each data like data1s, data2s, data3s, data4s, data5s. Then data1 consists of data1s...etc. I will try it asap.)
Could you show us to your c# codes? (meanwhile I couldnt tried your program just because of my arduino always connects COM28 ;) )
Regards

Parish92

yes, I have the same question that cengav4r. How do you to assign each line Data with one of the data that you want to print?. (Arduino One)

zitron

You can send 5 channels from arduino if you print like this, as shown in the first post:

Code: [Select]
 
  Serial.print(analogRead(A0));
  Serial.print(',');
  Serial.print(analogRead(A1));
  Serial.print(',');
  Serial.print(analogRead(A2));
  Serial.print(',');
  Serial.print(analogRead(A3));
  Serial.print(',');
  Serial.print(analogRead(A4));
  Serial.print(',');
  Serial.println(analogRead(A5));


If you need to connect to higher COM ports just type it into the text box.

flyblueskies

#5
May 04, 2014, 12:52 pm Last Edit: May 04, 2014, 01:01 pm by flyblueskies Reason: 1
Zitron,

This is off topic, but you developed a quick simconnect inteface for FSX to test a head tracker - see your post here: http://forum.arduino.cc/index.php?topic=8322.0

In it, you mention "I've got a program that interfaces with FSX camera control and serial port, all you need to do is send a comma separated string of pitch, roll yaw and so on. Should make it easy for anyone wanting to control FSX camera from arduino."

Any chance you might still have the simconnect interface (or code) that I can get?

Thanks -

FlyBlueSkies

cengav4r


You can send 5 channels from arduino if you print like this, as shown in the first post:

Code: [Select]
 
  Serial.print(analogRead(A0));
  Serial.print(',');
  Serial.print(analogRead(A1));
  Serial.print(',');
  Serial.print(analogRead(A2));
  Serial.print(',');
  Serial.print(analogRead(A3));
  Serial.print(',');
  Serial.print(analogRead(A4));
  Serial.print(',');
  Serial.println(analogRead(A5));


If you need to connect to higher COM ports just type it into the text box.


In order to using ",". I had solved that problem with
adding  Serial.println("A0" + Value);
on arduino firmware and delete it at C#.
Regards
Cenk

zitron


Zitron,

This is off topic, but you developed a quick simconnect inteface for FSX to test a head tracker - see your post here: http://forum.arduino.cc/index.php?topic=8322.0

In it, you mention "I've got a program that interfaces with FSX camera control and serial port, all you need to do is send a comma separated string of pitch, roll yaw and so on. Should make it easy for anyone wanting to control FSX camera from arduino."

Any chance you might still have the simconnect interface (or code) that I can get?

Thanks -

FlyBlueSkies


Holy crap that is 2009. I don't even use delphi any more. The program is here http://iluvtocnc.googlepages.com/CockpitCamera.zip I have no idea if it still works. I will have a look around for the source if you really want it.

flyblueskies


Holy crap that is 2009. I don't even use delphi any more. The program is here http://iluvtocnc.googlepages.com/CockpitCamera.zip I have no idea if it still works. I will have a look around for the source if you really want it.


Yep, knew that it was a shot in the dark. Glad you still had the link. Source code would be nice, but if you don't have it, no big deal. I just did not want to start from scratch.

Thanks for the link...I'll give it a try.

Go Up