Manchester Decode

This will decode the received manchester code on the pc-side, that’s coded by the Bascom sample .

'Manchester decoder VB5/6 Evert 2007 V1.0
Dim Mansword As Double
Mansword = Highbyte                                         'Make a word out of the high and low byte
Mansword = Mansword * 256
Mansword = Mansword + Lowbyte
Manchesterdecode = 0                                        'Set output to zero
For Lus = 1 To 8                                            'Run loop 8 times
Manchesterdecode = Manchesterdecode * 2                     'Shift the bit to the left
If(mansword And 49152) = 16384 Then                         'If the left 2 bits are 01
    Manchesterdecode = Manchesterdecode + 1                 ' Incr Output
End If
Mansword = Mansword * 4                                     'Shift bit 2x to the left
Next Lus
End Function