Hey www.freepascal.org crew!
Can somebody advice me the right values of
i2c_master.start(0, false);
and if it has to be placed in the main program loop or just like above ?
Greets, Wouter van Wegen
Typically you should use the address of the I2C device you want to communicate with. Using address 0 is the
general call address, which may or may not be what you are trying to do.
There is a simple example to show how to
read time from a DS1307.
PS: I am trying to I2C from my RPI3 on freepascal to my AVR on freepascal FPC-AVR
To do this one side needs to be the I2C master and the other side the slave. The I2C library you are referring to is for the AVR acting as the I2C master. If you want to use this, then the AVR needs to read data from the RPi, so the RPi needs to be running an I2C slave app. There are quite a number of discussions on this topic if you search for
Raspberry Pi as I2C slave.
But it will be easier in my opinion if you get a cheap I2C device such as a DS1307 real time clock, there are many examples on the internet on how to read this via I2C.