Dear all,
I am leaner . I wanted to plot graph time VS current. CUrrently i can get data serially from arduino. Now i wanted to plot graph for every 1 min w.r.t time.
As shown in below Link. I am facing problem in configuring the chart.If you can share link How he exactly uploaidng inputs will be help full.
http://www.dreamincode.net/forums/to...&#entry2055191
My code fine to this part.
Code:Imports System Imports System.IO.Ports Imports System.ComponentModel Imports System.Threading Imports System.Drawing Public Class Form1 Dim myPort As Array Dim Distance As Integer Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load myPort = IO.Ports.SerialPort.GetPortNames() PortComboBox.Items.AddRange(myPort) BaudComboBox.Items.Add(9600) BaudComboBox.Items.Add(19200) BaudComboBox.Items.Add(38400) BaudComboBox.Items.Add(57600) BaudComboBox.Items.Add(115200) ConnectButton.Enabled = True DisconnectButton.Enabled = False End Sub Private Sub ConnectButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ConnectButton.Click SerialPort1.PortName = PortComboBox.Text SerialPort1.BaudRate = BaudComboBox.Text SerialPort1.Open() Timer1.Start() 'lblMessage.Text = PortComboBox.Text & " Connected." ConnectButton.Enabled = False DisconnectButton.Enabled = True End Sub Private Sub DisconnectButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DisconnectButton.Click SerialPort1.Close() DisconnectButton.Enabled = False ConnectButton.Enabled = True End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Try SerialPort1.Write("c") System.Threading.Thread.Sleep(250) Dim k As Double Dim distance As String = SerialPort1.ReadLine() k = CDbl(distance) ListBoxSensor.Text = k Catch ex As Exception End Try End Sub Private Sub Relay_ON_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Relay_ON.Click SerialPort1.Write("1") End Sub Private Sub Relay_Off_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Relay_Off.Click SerialPort1.Write("0") End Sub End Class




Reply With Quote
