Interface for the Gravity Plug - see https://jeelabs.org/gp. More...
#include <Ports.h>
Public Member Functions | |
| GravityPlug (PortI2C &port) | |
| Constructor for Gravity Plug. | |
| void | begin () |
| Setup GravityPlug. Call during setup() | |
| void | sensitivity (byte range, word bw=0) |
| Set GravityPlug sensitivity. More... | |
| const int * | getAxes () |
| Get accelleration data from GravityPlug. More... | |
| char | temperature () |
| Read out the temperature (only for BMA150, not the older BMA020) More... | |
Public Member Functions inherited from DeviceI2C | |
| DeviceI2C (const PortI2C &p, uint8_t me) | |
| bool | isPresent () const |
| see if a device answers at an I2C address | |
| uint8_t | send () const |
| Create a start condition on the I2C bus, and set things up for sending data to this device. More... | |
| uint8_t | receive () const |
| Create a start condition on the I2C bus, and set things up for receiving data from this device. More... | |
| void | stop () const |
| Create a stop condition on the I2C bus, ending the current transfer. | |
| uint8_t | write (uint8_t data) const |
| Write a byte to the currently addressed device. More... | |
| uint8_t | read (uint8_t last) const |
| Read a byte from the currently addressed device. More... | |
| void | setAddress (uint8_t me) |
Interface for the Gravity Plug - see https://jeelabs.org/gp.
| const int * GravityPlug::getAxes | ( | ) |
Get accelleration data from GravityPlug.
| void GravityPlug::sensitivity | ( | byte | range, |
| word | bw = 0 |
||
| ) |
Set GravityPlug sensitivity.
| range | 2,4,8 |
| bw | (optional) bandwidth. |
| char GravityPlug::temperature | ( | ) |
Read out the temperature (only for BMA150, not the older BMA020)