|
PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
28 shift_out(device->sdi_pin, device->sck_pin,
MSBFIRST, 8, LIS3DH_OUT_ADC1_L | LIS3DH_MASK_READREPEAT);
30 signed short s =
shift_in(device->sdo_pin, device->sck_pin,
MSBPRE, 8);
31 s |= (
unsigned short)(
shift_in(device->sdo_pin, device->sck_pin,
MSBPRE, 8) << 8);
32 *ad1 = ((int)s) >> res;
35 s |= (
unsigned short)(
shift_in(device->sdo_pin, device->sck_pin,
MSBPRE, 8) << 8);
36 *ad2 = ((int)s) >> res;
39 s |= (
unsigned short)(
shift_in(device->sdo_pin, device->sck_pin,
MSBPRE, 8) << 8);
40 *ad3 = ((int)s) >> res;
Simplifies reading Parallax LIS3DH 3-Axis Accelerometer Module with ADC.
void lis3dh_adc(lis3dh_t *device, int *ad1, int *ad2, int *ad3)
Gets raw adc measurements from all three ADC channels.
int lis3dh_getADC(lis3dh_t *device, int channel)
Gets raw adc measurement from a single ADC channel.
int lis3dh_getResolution(lis3dh_t *device)
Reads the bit resolution setting from the sensor. 8-bit, 10-bit or 12-bit.