Glad it worked. Tip use the
gb button to add code to your post, it looks so much better
Public Sub Form_Open()
Dim f As Integer
Dim Pininit As String
For f = 4 To 27
Pininit = "pinctrl set " & Str(f) & " ip pd"
Shell Pininit
Next
End
Function GetIO(PinNo As Integer) As Boolean
Dim shellResult As String
Dim placeHolder As Integer
Dim pinResult As String
Dim returnIOvalue As Boolean
Dim shellString As String
shellString = "pinctrl get " & Str(PinNo)
Shell shellString To shellResult
placeholder = InStr(shellResult, "|")
pinResult = Mid$(shellResult, placeholder + 2, 2)
If pinResult = "hi" Then
returnIOvalue = True
Else
returnIOvalue = False
Endif
Return returnIOvalue
End
Public Sub Timer1_Timer()
Dim Redin As Boolean
Dim GreenIn As Boolean
Dim f As Integer
Dim RedGreen As New Boolean[13, 3]
'---- M140 ----
Redin = GetIO(4)
GreenIn = GetIO(5)
RedGreen[1, 1] = Redin
RedGreen[1, 2] = GreenIn
Label1.Background = Color.Gray
If RedGreen[1, 1] = True Then
Label1.Background = Color.Red
Else
If RedGreen[1, 2] = True Then
Label1.Background = Color.Green
Endif
Endif
'---- S700 ----
Redin = GetIO(6)
GreenIn = GetIO(7)
RedGreen[2, 1] = Redin
RedGreen[2, 2] = GreenIn
Label2.Background = Color.Gray
If RedGreen[2, 1] = True Then
Label2.Background = Color.Red
Else
If RedGreen[2, 2] = True Then
Label2.Background = Color.Green
Endif
Endif