Is there any way to read from a specific register address using I2C? I have an IC that has over 16 register addresses and I want to read only 2 of them (the third 0x02 and twelve 0X12).
Thank you.
Is there any way to read from a specific register address using I2C? I have an IC that has over 16 register addresses and I want to read only 2 of them (the third 0x02 and twelve 0X12).
Thank you.
Read the datasheet of that device.
In most cases a device has an internal register pointer. So that is written first and after that a few bytes are read.
I decided to use this library which is much better DssCircuits.com is for sale | HugeDomains
What is the best way to read data from registers? Inside the loop() or where? I am asking this because I am trying to build a small car fm transmitter and although I managed to transmit there is a small noise (pop) every time I read the registers inside the loop(); Based on the readings if something is not correct I make some writtings in the registers.
You can read and write the registers of the device in the loop.
With audio devices that can result in a 'pop' or 'click' sound. As far as I know that is always a hardware problem. It is mostly caused by the way the circuit is designed, but perhaps it can be caused in the chip itself.
you should make separate functions to read the register.
Give the functions a descriptive names that reflect the function of the register.
Then you can call it anywhere (after the device is properly initialized of course)
int read_antimatterflux(int deviceid)
{
// code to read register 2 from named deviceid
}
int get_gravity_status(int deviceid)
{
// code to read register 12
}