Manchester Decode

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

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