本文整理汇总了Java中com.google.android.things.contrib.driver.bmx280.Bmx280SensorDriver类的典型用法代码示例。如果您正苦于以下问题:Java Bmx280SensorDriver类的具体用法?Java Bmx280SensorDriver怎么用?Java Bmx280SensorDriver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Bmx280SensorDriver类属于com.google.android.things.contrib.driver.bmx280包,在下文中一共展示了Bmx280SensorDriver类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.google.android.things.contrib.driver.bmx280.Bmx280SensorDriver; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.i(TAG, "Starting TemperatureActivity");
mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
mSensorManager.registerDynamicSensorCallback(mDynamicSensorCallback);
try {
mTemperatureSensorDriver = new Bmx280SensorDriver(BoardDefaults.getI2CPort());
mTemperatureSensorDriver.registerTemperatureSensor();
} catch (IOException e) {
Log.e(TAG, "Error configuring sensor", e);
}
}
示例2: createSensorDriver
import com.google.android.things.contrib.driver.bmx280.Bmx280SensorDriver; //导入依赖的package包/类
public static Bmx280SensorDriver createSensorDriver() throws IOException {
return new Bmx280SensorDriver(BOARD.getI2cBus());
}