Sub Capture
datoconv.Initialize
Dim i, y As Int
Dim b(3) As Byte
For y = 2 To 0 Step -1
For i = 1 To 8
Ck.State = True
If Dout.State = False Then
datoconv.Append("0")
Else
datoconv.Append("1")
End If
Ck.State = False
Next
b(y) = Bit.ParseInt(datoconv, 2)
datoconv.Initialize
Next
Ck.State = True
Ck.State = False
b(2) = Bit.Xor(b(2), 0x80)
Dim result As Int = Bit.Or(Bit.ShiftLeft(b(2),16), Bit.ShiftLeft(b(1), 8))
result = Bit.Or(result, Bit.ShiftLeft(b(0), 1))
CallSubDelayed2(mTarget, "VisDato", result)
Log(b(2) & " " & b(1) & " " & b(0))
Sleep(10)
End Sub