Pages: [1]   Go Down
Author Topic: Multi-channle data plot/streaming/graphing thing  (Read 3686 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 1
Posts: 222
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: 24
Posts: 1766
... 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: 16
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: 222
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

Pages: [1]   Go Up
Jump to: