.. module:: FBM320 ************** FBM320 Module ************** .. _datasheet: http://www.fmti.com.tw/fmti689/program_download/good/201702101732113548.pdf This module contains the Zerynth driver for FBM320 digital barometer. The FBM320 is a digital pressure sensor which consists of a MEMS piezoresistive pressure sensor and a signal conditioning ASIC. The ASIC include a 24bits sigma-delta ADC, OTP memory for calibration data, and serial interface circuits. The FBM320 features I2C and SPI digital interfaces, the present library enables I2C only. =============== FBM320 class =============== .. class:: FBM320(drvname, addr=0x6D, clk=400000) Creates an intance of the FBM320 class. :param drvname: I2C Bus used '( I2C0, ... )' :param addr: Slave address, default 0x6D. If SDO pin is pulled low, I2C address is 6C. If SDO pin is pulled high, I2C address is 6D. :param clk: Clock speed, default 400kHz Barometer values can be easily obtained from the sensor: :: from formosa.fbm320 import fbm320 ... fbm = fbm320.FBM320(I2C0) temp, press, altitude = fbm.get_values() .. method:: set_osr(osr) :param osr: is the oversampling rate to set. Values accepted: 1024, 2048, 4096 or 8192. Set oversampling rate. .. method:: get_temp() Return the temperature in degrees Celsius. .. method:: get_press() Return the pressure in hPa. .. method:: get_altitude(pressure) :param pressure: pressure value in hPa. Return the altitude in metres. .. method:: get_values() Return the temperature (°C), pressure (hPa) and altitude (m) in a list [temperature, pressure, altitude].