Hi guys,
thanks for the reply.
alright so this is how i get the byte from the register.
uint8_t LSM6DS3::sensor( void )
{
uint8_t output;
readRegister(&output, LSM6DS3_ACC_GYRO_FUNC_SRC);
return output;
}
So if i'm supposed to use bitRead(x, n);
then i replace the x with output then the n is 5 right ?
example:
int something = 0;
something = bitRead(output, 5);
the return output definitely does contain some values
but when i print output
say,
Serial.print(output);
I get 0 as a result
I know uint8_t returns a byte
after return output, should i convert the content of output into another type
before bitRead(x, n); ??
or perhaps using uint8_t isn't the right approach to extract byte from the register