Asked — Edited

Converting C# To VB

is the VB implementation as "complete" as the C# implementation? For instance, the following is a line in C#: _ezb.ADC.GetADCValue(ADC.ADCEnum.ADC_0);. I can not find a VB equivalent, all I find for VB is: EZ_B.ADC.ADCPortEnum EZ_B.ADC.Equals and EZ_B.ADC.ReferenceEquals

How do I get the ADC value?

jms


ARC Pro

Upgrade to ARC Pro

Become a Synthiam ARC Pro subscriber to unleash the power of easy and powerful robot programming

#1  

as a followup, is there a way to read the DLL so I can see all the methods in VB?

jms

PRO
Synthiam
#2  

The following code extends the VB example within the SDK Download. I added a button (named btnGetADC) and a Label (named lblADCVal).

When the button is pressed, the value of the ADC0 will be displayed in the lblADCVal :)


Public Class Form1


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        TrackBar1.Minimum = EZ_B.Servo.SERVO_MIN
        TrackBar1.Maximum = EZ_B.Servo.SERVO_MAX
        TrackBar1.Value = EZ_B.Servo.SERVO_CENTER
    End Sub


    Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll

        EzB_Connect1.EZB.Servo.SetServoPosition(EZ_B.Servo.ServoPortEnum.RB0, TrackBar1.Value)
    End Sub

    Private Sub btnGetADC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGetADC.Click

        lblADCVal.Text = String.Format("{0} Volts", EzB_Connect1.EZB.ADC.GetADCVoltage(EZ_B.ADC.ADCPortEnum.ADC0))
    End Sub
End Class