How to get Voltage value from analog input ???
Posted: Sat Dec 05, 2020 8:35 pm
Hello everyone
I been playing around with my 8/8/8 interface
Been trying to get voltage from all 8 analog inputs
I got one working but all others are displaying the same
I am not very good at this vb stuff but i have fun
I been playing around with my 8/8/8 interface
Been trying to get voltage from all 8 analog inputs
I got one working but all others are displaying the same
I am not very good at this vb stuff but i have fun
Code: Select all
Imports Phidget22
Imports Phidget22.Events
Public Class Form1
Dim WithEvents device As Phidget22.VoltageInput
Public Sub New()
Phidget22.Phidget.InvokeEventCallbacks = True
InitializeComponent()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
device = New Phidget22.VoltageInput()
device.Open()
End Sub
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
If device.Attached Then
device.Close()
End If
End Sub
Private Sub device_VoltageChange0(ByVal sender As Object, ByVal e As Phidget22.Events.VoltageInputVoltageChangeEventArgs) Handles device.VoltageChange
device.Channel = "0"
TextBox0.Text = device.Voltage.ToString() + " "
End Sub
Private Sub device_VoltageChange1(ByVal sender As Object, ByVal e As Phidget22.Events.VoltageInputVoltageChangeEventArgs) Handles device.VoltageChange
device.Channel = "1"
TextBox1.Text = device.Voltage.ToString() + " "
End Sub
Private Sub device_VoltageChange2(ByVal sender As Object, ByVal e As Phidget22.Events.VoltageInputVoltageChangeEventArgs) Handles device.VoltageChange
device.Channel = "2"
TextBox2.Text = device.Voltage.ToString() + " "
End Sub
Private Sub device_VoltageChange3(ByVal sender As Object, ByVal e As Phidget22.Events.VoltageInputVoltageChangeEventArgs) Handles device.VoltageChange
device.Channel = "3"
TextBox3.Text = device.Voltage.ToString() + " "
End Sub
End Class