Re: Raspberry Pi and the BMP085
Re: Raspberry Pi and the BMP085
Re: Raspberry Pi and the BMP085
Re: Raspberry Pi and the BMP085
Re: Raspberry Pi and the BMP085
Re: Raspberry Pi and the BMP085
Re: Raspberry Pi and the BMP085
Re: Raspberry Pi and the BMP085
Re: Raspberry Pi and the BMP085
Re: Raspberry Pi and the BMP085
def readU16(self, reg):
"Reads an unsigned 16-bit value from the I2C device"
try:
hibyte = self.readU8(reg)
lobyte = self.readU8(reg+1)
result = (hibyte << 8) + lobyte
#result = self.bus.read_word_data(self.address,reg)
if (self.debug):
print "I2C: Device 0x%02X returned 0x%04X from reg 0x%02X" % (self.address, result & 0xFFFF, reg)
return result
except IOError, err:
return self.errMsg()
def readS16(self, reg):
"Reads a signed 16-bit value from the I2C device"
try:
hibyte = self.readS8(reg)
lobyte = self.readU8(reg+1)
result = (hibyte << 8) + lobyte
#result = self.bus.read_word_data(self.address,reg)
if (self.debug):
print "I2C: Device 0x%02X returned 0x%04X from reg 0x%02X" % (self.address, result & 0xFFFF, reg)
return result
except IOError, err:
return self.errMsg()
Re: Raspberry Pi and the BMP085
Re: Raspberry Pi and the BMP085
Re: Raspberry Pi and the BMP085
Re: Raspberry Pi and the BMP085
webide@raspberrypi /usr/share/adafruit/webide/repositories/Adafruit-Raspberry-Pi-Python-Code/Adafruit_BMP085 $ sudo python Adafruit_BMP085_example.py
Temperature: 24.50 C
Pressure: 1020.20 hPa
Altitude: -58.78