Attribute VB_Name = "Module1"

'===============================================
' IO00/TX0
Public Sub IO00_FUN()
   DIO(0) = DIO(0) + 1
   If DIO(0) >= 2 Then
    DIO(0) = 0
   End If
  
   If DIO(0) = 0 Then      'in00
      main.IO00.Caption = "in00"
      main.D0.Text = " "
   End If
   
   If DIO(0) = 1 Then      'out00
      main.IO00.Caption = "out00"
      main.D0.Text = "1"
   End If
   

  
End Sub
'=============================================
'IO01/RX0
Public Sub IO01_FUN()
   DIO(1) = DIO(1) + 1
   If DIO(1) >= 2 Then
    DIO(1) = 0
   End If
  
   If DIO(1) = 0 Then      'in01
      main.IO01.Caption = "in01"
      main.D1.Text = " "
   End If
   
   If DIO(1) = 1 Then      'out01
      main.IO01.Caption = "out01"
      main.D1.Text = "1"
   End If
   
End Sub
'=============================================
'IO02/Counter0
Public Sub IO02_FUN()
   DIO(2) = DIO(2) + 1
   If DIO(2) >= 4 Then
    DIO(2) = 0
   End If
  
   If DIO(2) = 0 Then      'in02
      main.IO02.Caption = "in02"
      main.D2.Text = " "
   End If
   
   If DIO(2) = 1 Then      'out02
      main.IO02.Caption = "out02"
      main.D2.Text = "1"
   End If
   
   If DIO(2) = 2 Then      'Count0
      main.IO02.Caption = "Count0"
      main.D2.Text = "Count0; H->L"
      main.MSCom.Output = "~ct0h~"       'MSCOM Send
   End If
   
   If DIO(2) = 3 Then      'Count0
      main.IO02.Caption = "Count0"
      main.D2.Text = "Count0; L->H"
      main.MSCom.Output = "~ct0l~"       'MSCOM Send
   End If
   
End Sub
'=============================================
'IO03
Public Sub IO03_FUN()
   DIO(3) = DIO(3) + 1
   If DIO(3) >= 2 Then
    DIO(3) = 0
   End If
  
   If DIO(3) = 0 Then
      main.IO03.Caption = "in03"
      main.D3.Text = " "
   End If
   
   If DIO(3) = 1 Then
      main.IO03.Caption = "out03"
      main.D3.Text = "1"
   End If
   
   
End Sub
'=============================================
'IO04
Public Sub IO04_FUN()
   DIO(4) = DIO(4) + 1
   If DIO(4) >= 2 Then
    DIO(4) = 0
   End If
  
   If DIO(4) = 0 Then
      main.IO04.Caption = "in04"
      main.D4.Text = " "
   End If
   
   If DIO(4) = 1 Then
      main.IO04.Caption = "out04"
      main.D4.Text = "1"
   End If
End Sub
'=============================================
'IO05
Public Sub IO05_FUN()
   DIO(5) = DIO(5) + 1
   If DIO(5) >= 2 Then
    DIO(5) = 0
   End If
  
   If DIO(5) = 0 Then
      main.IO05.Caption = "in05"
      main.D5.Text = " "
   End If
   
   If DIO(5) = 1 Then
      main.IO05.Caption = "out05"
      main.D5.Text = "1"
   End If
End Sub
'=============================================
'IO06
Public Sub IO06_FUN()
   DIO(6) = DIO(6) + 1
   If DIO(6) >= 2 Then
    DIO(6) = 0
   End If
  
   If DIO(6) = 0 Then
      main.IO06.Caption = "in06"
      main.D6.Text = " "
   End If
   
   If DIO(6) = 1 Then
      main.IO06.Caption = "out06"
      main.D6.Text = "1"
   End If
End Sub
'=============================================
'IO07
Public Sub IO07_FUN()
   DIO(7) = DIO(7) + 1
   If DIO(7) >= 2 Then
    DIO(7) = 0
   End If
  
   If DIO(7) = 0 Then
      main.IO07.Caption = "in07"
      main.D7.Text = " "
   End If
   
   If DIO(7) = 1 Then
      main.IO07.Caption = "out07"
      main.D7.Text = "1"
   End If
End Sub
'=============================================
'IO08/ADC0
Public Sub IO08_FUN()
   DIO(8) = DIO(8) + 1
   If DIO(8) >= 3 Then
    DIO(8) = 0
   End If
  
   If DIO(8) = 0 Then
      main.IO08.Caption = "in08"
      main.D8.Text = " "
   End If
   
   If DIO(8) = 1 Then
      main.IO08.Caption = "out08"
      main.D8.Text = "1"
   End If
   
   If DIO(8) = 2 Then
      main.IO08.Caption = "ADC0"
      main.D8.Text = "A0"
   End If
End Sub
'=============================================
'IO09/ADC1
Public Sub IO09_FUN()
   DIO(9) = DIO(9) + 1
   If DIO(9) >= 3 Then
    DIO(9) = 0
   End If
  
   If DIO(9) = 0 Then
      main.IO09.Caption = "in09"
      main.D9.Text = " "
   End If
   
   If DIO(9) = 1 Then
      main.IO09.Caption = "out09"
      main.D9.Text = "1"
   End If
   
   If DIO(9) = 2 Then
      main.IO09.Caption = "ADC1"
      main.D9.Text = "A1"
   End If
End Sub
'=============================================
'IO0A/ADC2
Public Sub IO0A_FUN()
   DIO(10) = DIO(10) + 1
   If DIO(10) >= 3 Then
    DIO(10) = 0
   End If
  
   If DIO(10) = 0 Then
      main.IO0A.Caption = "in0A"
      main.D10.Text = " "
   End If
   
   If DIO(10) = 1 Then
      main.IO0A.Caption = "out0A"
      main.D10.Text = "1"
   End If
   
   If DIO(10) = 2 Then
      main.IO0A.Caption = "ADC2"
      main.D10.Text = "A2"
   End If
End Sub
'=============================================
'IO0B/ADC3
Public Sub IO0B_FUN()
   DIO(11) = DIO(11) + 1
   If DIO(11) >= 3 Then
    DIO(11) = 0
   End If
  
   If DIO(11) = 0 Then
      main.IO0B.Caption = "in0B"
      main.D11.Text = " "
   End If
   
   If DIO(11) = 1 Then
      main.IO0B.Caption = "out0B"
      main.D11.Text = "1"
   End If
   
   If DIO(11) = 2 Then
      main.IO0B.Caption = "ADC3"
      main.D11.Text = "A3"
   End If
End Sub
'=============================================
'IO0C/PWM0
Public Sub IO0C_FUN()
   DIO(12) = DIO(12) + 1
   If DIO(12) >= 3 Then
    DIO(12) = 0
   End If
  
   If DIO(12) = 0 Then
      main.IO0C.Caption = "in0C"
      main.D12.Text = " "
   End If
   
   If DIO(12) = 1 Then
      main.IO0C.Caption = "out0C"
      main.D12.Text = "1"
   End If
   
   If DIO(12) = 2 Then
      main.IO0C.Caption = "PWM0"
      main.D12.Text = "100"
   End If
End Sub
'=============================================
'IO0D/PWM1
Public Sub IO0D_FUN()
   DIO(13) = DIO(13) + 1
   If DIO(13) >= 3 Then
    DIO(13) = 0
   End If
  
   If DIO(13) = 0 Then
      main.IO0D.Caption = "in0D"
      main.D13.Text = " "
   End If
   
   If DIO(13) = 1 Then
      main.IO0D.Caption = "out0D"
      main.D13.Text = "1"
   End If
   
   If DIO(13) = 2 Then
      main.IO0D.Caption = "PWM1"
      main.D13.Text = "100"
   End If
   
End Sub


