**Appendix A. Code for the Program on Visual Basic**

The next step involved introducing the following command: Command for the input variable: Private Declare Function Inp Lib "inpout32.dll" \_ Alias "Inp32" (ByVal PortAddress As Integer) As Integer Command for the output variable: Private Declare Sub Out Lib "inpout32.dll" \_ Alias "Out32" (ByVal PortAddress As Integer, ByVal Value As Integer) Command to tell the program that a delay function exists in milliseconds: Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) The following instructions are given to the MOTOR TURNS TO THE LEFT button. Private Sub Command2\_Click() MsgBox ("BE SURE THAT THE MOTOR IS TURNING COUNTER CLOCKWISE. PRESS OK TO START") Dim x As Integer For x = 10 To 500 Sleep 200 Out &H378, 6 Sleep 200 Out &H378, 5 Sleep 200 Out &H378, 9 Sleep 200 Out &H378, 10 Sleep 200 Next x MsgBox ("END OF TEST TO THE LEFT") End Sub Now, instructions are given to the MOTOR TURNS TO THE RIGHT button. Private Sub Command4\_Click() MsgBox ("BE SURE THAT THE MOTOR IS TURNING CLOCKWISE. PRESS OK TO START") Dim x As Integer For x = 10 To 500 Sleep 200 Out &H378, 10 Sleep 200 Out &H378, 9 Sleep 200

Out &H378, 5 Sleep 200 Out &H378, 6 Sleep 200 Next x MsgBox ("END OF TEST TO THE RIGHT") End Sub Finally, instructions are given for the EXIT TEST button. Private Sub Command3\_Click() MsgBox ("ARE YOU SURE YOU WANT TO EXIT?") End End Sub
