For example, Handler pseudocode
pwidth = now - last
If pwidth > 500
STATE= header
If pwidth < 300 (microseconds)
bits[bitno++] = 1
else ( pwidth is between 300 and 500 )
bits[bitno++] = 0
If bitno >= 76
STATE = done
Thanks!
John