I am new with MegunoLink and I find it just wonderful! I really wnat to congratulate the team working on it! Really sophisticated software!
I am right now a trial user but have already ordered one copy in name of my research centre. I trying a simple project. I am using MegunoLink as a tool to plot sensor data from two pressure sensors in real time using "TimePlot" visualizer. But one strange thing which I am facing is that I can#t understand the .csv file generated when I press 'save chart data'. Though I can see the pressure values in the file, I can#t really understand the time stamps.. These are some really large numbers like:
How do I interpret this value! Is it a time stamp at all? Maybe in trial version this feature doesnt work? I am really confused!42534.0613491666,
I a sharing my arduino code below:
Code: Select all
#include <MegunoLink.h>
TimePlot MyPlot;
int analogInPin0 = A0; // Analog input pins that the Refernece sensors are attached to
int analogInPin1 = A1;
int sensorValue0 = 0; // value read from the pot
int sensorValue1 = 0;
int Max = 1023; // minimum sensor value
int Min = 0; // maximum sensor value
void setup() {
pinMode(A0, INPUT);
pinMode(A1, INPUT);
// initialize serial communications at 9600 bps:
Serial.begin(9600);
Serial.println("live plotter");
MyPlot.SetTitle("Live sensor data");
MyPlot.SetXlabel("Time (sec)");
MyPlot.SetYlabel("Pressure (mbar)");
}
void loop() {
sensorValue0 = analogRead(analogInPin0);
sensorValue1 = analogRead(analogInPin1);
float voltage0 = sensorValue0 * (5.0 / 1023.0);
float voltage1 = sensorValue1 * (5.000 / 1023.000);
float pressure0 = ((voltage0*12.5)-28.125);
float pressure1 = ((voltage1*12.5)-28.125);
//Serial.print(sensorValue0);
Serial.print(pressure0,4);
Serial.print(",");
Serial.println(pressure1,4);
MyPlot.SendData("pressure_shortertube",pressure0, TimePlot::Red, TimePlot::Solid, 3, TimePlot::Circle);
MyPlot.SendData("pressure_longertube",pressure1, TimePlot::Blue, TimePlot::Dashed, 3, TimePlot::Circle);
delay(200);
}
For the TimePlot, I am using the time properties as shown in the attached screenshot...
I really look forward to your support! Thanking you in advances
Cheers!
Pramit