Designating 2 Arduinos as both Master and Slave
is possible write code such 2 arduinos communicating each other both make use of master , slave functionality?
setup: using 2 arduinos because have lot of equipment requires being monitored , operated , more 1 arduino multitasking simpler.
things want take advantage of:
wire.onrequest()
wire.onrecieve()
if can have these functions working on both devices, enables them send , receive data @ (depending on hear xyz sensor/button/device), extremely useful.
the place can see there being issues wire.begin() not yet understand how works.
thanks,
cypher
*edit, realize wire.begin() function may require address in case of slave, , in examples, wire.begin() listed in setup(), not use function outside of setup() when changing direction of these commands / requests?
*edit 2, i'm trying due possibly superfluous , can done in manner intended master/slave relationship?
setup: using 2 arduinos because have lot of equipment requires being monitored , operated , more 1 arduino multitasking simpler.
things want take advantage of:
wire.onrequest()
wire.onrecieve()
if can have these functions working on both devices, enables them send , receive data @ (depending on hear xyz sensor/button/device), extremely useful.
the place can see there being issues wire.begin() not yet understand how works.
thanks,
cypher
*edit, realize wire.begin() function may require address in case of slave, , in examples, wire.begin() listed in setup(), not use function outside of setup() when changing direction of these commands / requests?
*edit 2, i'm trying due possibly superfluous , can done in manner intended master/slave relationship?
wire.begin() initializes i2c in master mode.
wire.begin(0xa1) initializes i2c in master , slave mode.
if use parameter slave address, every possible combinations of master, slave, onreceive , onrequest possible.
the problem how prevent 2 arduinos want become master @ same time.
wire.begin(0xa1) initializes i2c in master , slave mode.
if use parameter slave address, every possible combinations of master, slave, onreceive , onrequest possible.
the problem how prevent 2 arduinos want become master @ same time.
Arduino Forum > Using Arduino > General Electronics > Designating 2 Arduinos as both Master and Slave
arduino
Comments
Post a Comment