That’s about how I would have gone about it i.e. reading it with timing, and looking at the buffer later,
It looks like a job for portb.0 interrupt so the code doesn’t have to spend most time waiting.
It’s a shame there isn’t an option in PBP to carry the bit after rotating a byte like humid to wrap it in a loop.
For the last part the timing doesn’t matter anymore. There’s more than one way to skin a cat.
Code:bb var byte ‘ bit index ii var byte ‘ counter dbit var byte[7] ‘ declare the array of bytes representing received bit times humid = 0 ‘ reset humid! bb = 1 ‘ set intial index value for ii = 0 to 6 ‘ address each bit if dbit[ii] > 29 then humid = humid + bb ‘ set the bit endif bb = bb + bb ‘ multiply index by 2 each step next ii




Bookmarks