[riot-devel] I2C - Arduino <-> SAMR21-xpro
alexandre.abadie at inria.fr
Fri Aug 5 16:52:02 CEST 2016
Unfortunately, the current I2C API in RIOT only supports the master mode so you won't be able to use your samr21-xpro as slave on this kind of bus.
I don't know how complex it is to add support for this feature btw.
----- Mail original -----
> Hi all,
> There is someone who tried to interface arduino to RIOT (the board in my case
> is SAMR21-xpro) through the I2C ?
> I would config the Arduino as MASTER (i've already did it with wire.h) and
> samr21 as SLAVE.
> I did a code like this :
> int main(void)
> puts("I2C Reader");
> /* define own shell commands */
> //char line_buf[SHELL_DEFAULT_BUFSIZE];
> //shell_run(shell_commands, line_buf, SHELL_DEFAULT_BUFSIZE);
> char data;
> int read=0;
> puts("waiting for data...");
> read = i2c_read_byte(0, 8, data);
> puts("ERROR : UNDEFINED DEVICE");
> }else if(read>0)
> printf("data arrived : %c",data);
> return 0;
> Arduino will send 5 byte at time, but the samr21 doesn't receive
> nothing....any ideas?
> Thanks all !
> best regards,
> devel mailing list
> devel at riot-os.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the devel