921
General Mach Discussion / Re: Homing?Limits
« on: May 14, 2020, 01:46:02 PM »
you do not have to insert it, just Chose the file and hit Post
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
'example to write UserLed 2201-2208 to port
'Our port address
PortAddr = 1016 '0x3f8
PortData = 0
If (GetUserled(2201) = 1) Then
PortData = PortDate + 1
End If
If (GetUserled(2202) = 1) Then
PortData = PortDate + 2
End If
If (GetUserled(2203) = 1) Then
PortData = PortDate + 4
End If
If (GetUserled(2204) = 1) Then
PortData = PortDate + 8
End If
If (GetUserled(2205) = 1) Then
PortData = PortDate + 16
End If
If (GetUserled(2206) = 1) Then
PortData = PortDate + 32
End If
If (GetUserled(2207) = 1) Then
PortData = PortDate + 64
End If
If (GetUserled(2208) = 1) Then
PortData = PortDate + 128
End If
PortData = PutPortByte(PortAddr, PortData)
' Our port address
PortAddr = 1016 ' 0x3f8
' Read data register of parallel port at 0x3f8
PortData = GetPortByte(PortAddr)
' write the data to OEMLed's
SetUserLed(2001,PortData And &H01)
SetUserLed(2002,PortData And &H02)
SetUserLed(2003,PortData And &H04)
SetUserLed(2004,PortData And &H08)
SetUserLed(2005,PortData And &H10)
SetUserLed(2006,PortData And &H20)
SetUserLed(2007,PortData And &H40)
SetUserLed(2008,PortData And &H80)