June 2017
Intermediate to advanced
232 pages
5h 4m
English
The Bmx280.java is the class that makes the heavy work and if we want to implement the new feature that reads the humidity we have to modify it. Moreover, you need the manufacturer datasheet (https://cdn-shop.adafruit.com/datasheets/BST-BME280_DS001-10.pdf) in order to know how to exchange data with the sensor. Let us examine it.
To open a connection to an external sensor we need an instance of the PeripheralManagerService class:
PeripheralManagerService pioService = new PeripheralManagerService();
Then, the class opens the connection using:
I2cDevice device = pioService.openI2cDevice(bus, I2C_ADDRESS);
Where:
Read now
Unlock full access