![Forenex FES91W Series User Manual Download Page 49](http://html1.mh-extra.com/html/forenex/fes91w-series/fes91w-series_user-manual_2318966049.webp)
49
-
'The following program is how to execute GPIO function on RadioButton
Private
Sub
RadioButton2_CheckedChanged(
ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
RadioButton17.CheckedChanged
If
ComboBox1.SelectedIndex = 0
Then
' Select GPIO become Output mode
If
RadioButton2.Checked =
True
Then
'LOW
gpio_output(0, 0)
'Set GPIO(0) to be output mode and set voltage is LOW
End
If
End
If
If
ComboBox1.SelectedIndex = 1
Then
' Select GPIO become Input mode
If
RadioButton17.Checked =
True
Then
'LOW
End
If
End
If
End
Sub
'The following program is how to execute GPIO function on ComboBox
Private
Sub
ComboBox1_SelectedIndexChanged(
ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
ComboBox1.SelectedIndexChanged
Dim
input_status
As
Integer
If
ComboBox1.SelectedIndex = 0
Then
' Select GPIO become Output mode
RadioButton1.Enabled =
True
'Hight
RadioButton17.Enabled =
True
'Low
Else
' Select GPIO become Input mode
input_status = gpio_input(0)
'Set GPIO(0) as input mode and read intput voltage
If
input_status = 1
Then
'If read voltage is HI
RadioButton1.Checked =
True
RadioButton1_CheckedChanged(sender, e)
ElseIf
input_status = 0
Then
' If read voltage is Low
RadioButton2.Checked =
True
RadioButton2_CheckedChanged(sender, e)
End
If
End
If
End
Sub
●When GPIO as Output mode, user can select voltage level Hi or Low by RadioButton.