Pages: [1]   Go Down
Author Topic: Multi-channle data plot/streaming/graphing thing  (Read 5135 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 1
Posts: 223
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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
« Last Edit: January 17, 2012, 08:54:25 am by zitron » Logged

Topsham, Vermont USA
Offline Offline
Edison Member
*
Karma: 33
Posts: 1906
... in The Woods In Vermont
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

THANKS! I'm running it now....
Logged

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

Türkiye
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-wink )
Regards
« Last Edit: July 01, 2013, 06:55:58 am by cengav4r » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
A Coruña, Galicia
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
Logged

0
Offline Offline
Full Member
***
Karma: 1
Posts: 223
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Code:
 
  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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: May 04, 2014, 06:01:47 am by flyblueskies » Logged

Türkiye
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Code:
 
  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
Logged

0
Offline Offline
Full Member
***
Karma: 1
Posts: 223
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: