Hello!
First of all I would like to apologize if this question stupid. But as they say there are no stupid questions.
I’m trying to build this FM transmitter thingy and I need help.
I’m using Arduino Nano and the chip is BK1085 TSSOP16
I hooked up the hardware but for me now comes the hard part – Software. I’m trying to control the chip via the I2C . The datasheet has all the necessary information but I don’t know how to use it to my advantage.
I have read the I2C protocols and stuff but I just don’t get it (yet). So can some bright mind help me with my quest? How to I access the addresses and change stuff? I have watched countless videos but they mostly read from I2C devices.
Thanks.
I'm trying to build this FM transmitter thingy and I need help.
Thingy?
The datasheet has all the necessary information but I don't know how to use it to my advantage.
Have you tried the I2C scanner that Nick Gammon has on his web site? Do you know the address of the thingy, and that it is connected to the Arduino correctly?
How to I access the addresses and change stuff?
Start by defining what address(es) you want to access and what "stuff" you want to change.
writing to a register comes down to code like this: (16 bits is similar)
int writeRegister(uint8_t reg, uint8_t data)
{
Wire.beginTransmission(device_address);
Wire.write(reg);
Wire.write(data);
int rv = Wire.endTransmission(); // does the actual writing, you need to check the return value!
return rv;
}
reading from a register :
int readRegister(uint8_t reg, uint8_t *data)
{
Wire.beginTransmission(device_address);
Wire.write(reg);
int rv = Wire.endTransmission(); // does the actual writing, you need to check the return value!
Wire.requestFrom(device_address, 2);
*data = Wire.read();
return rv;
}