Closed asheeshr closed 10 years ago
It's just to be safe, since Python doesn't have strict types you could get a numeric value greater than 8 bits which will usually fail when I2C, SPI, etc. functions interpret the data. The bitwise and with 0xFF just ensures only the lower 8 bits of the value are used. It's not strictly required in a lot of spots but can't hurt to have as a precaution.
In Adafruit_ADS1x15.py, at multiple places this bitwise manipulation is performed.
Which is equivalent to:
What is the point of this operation? Wont this always evaluate to
result[1]
and is therefore unnecessary?