Isolating bytes with an xbee.

Is there any possible way to isolate an 8 bit packet on the receive side of an xbee?

for example,
If xbee.rx << 8 (ex. 00101101, ignoring anything less than 8 bytes.)
MainButtons := xbee.rx

Thanks,
Ryan Canaway

Comments

  • JonnyMacJonnyMac Posts: 6,298
    edited 2019-11-15 - 23:19:09
    Do you mean isolate an individual bit or bits within a byte (or word or long)? To get a single bit (0 or 1), you can use this method.
    pub get_bit(value, bitpos)
    
      return (value >> bitpos) & 1
    
    Jon McPhalen
    Hollywood, CA
    It's Jon or JonnyMac -- please do not call me Jonny.
Sign In or Register to comment.