using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using JYUSB101;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
double[] data = new double[1000];
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int sum = 0;
textBox1.Text = sum.ToString();
if (sum>-1)
{
led1.Value = true;
}
JYUSB101AITask aitask = new JYUSB101AITask(0);
aitask.AddChannel(0);
aitask.SampleRate = 1000;
aitask.SamplesToAcquire = 1000;
aitask.Start();
aitask.ReadData(ref data);
easyChart1.Plot(data);
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using JYUSB101;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
double[,] data = new double[2,1000];
JYUSB101AITask aitask = new JYUSB101AITask(0);
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int sum = 0;
textBox1.Text = sum.ToString();
if (sum>-1)
{
led1.Value = true;
}
aitask.AddChannel(0);
aitask.AddChannel(1);
aitask.SampleRate = 1000;
aitask.SamplesToAcquire = 1000;
aitask.Start();
timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
aitask.ReadData(ref data);
easyChart1.Plot(data);
}
private void button2_Click(object sender, EventArgs e)
{
led2.Value = true;
timer1.Stop();
aitask?.Stop();
}
private void led2_Load(object sender, EventArgs e)
{
}
}
}