EasyTransfer-I2C 2-way Master<->Slave Communication
hi!
i have application establish 2-way communicate between 2 arduino nanos using i2c using "easytransfer". easytransfer comes i2c library, when trying establish 2-way communication using failed opened library , can tell library did not support this. posted message on author's website here: http://www.billporter.info/forum/topic/easytransfer-i2c-two-way-communication/#post-2641
what lead me believe 2-way communication had not been worked out fact easytransferi2c::senddata contained code specific sending data master slave , receivedata contained code specific receiving data master slave.
my solution modify library , make i2c_address inputs ::senddata() , ::receivedata() optional. if input supplied, assumes master -> slave communication. if no input supplied code assumes slave responding master request.
attached library , code. think i'm close, master -> slave communication working properly. example code expansion of original example code. here gist of processes (how should work):
1. master declares random "blinks" , "pause" variable
2. master sends slave data
3. slave receives data, blinks , pauses led_indicator based on data
4. master requests slave send data it
5. slave send "blinks" , "pause" variables
6. master receives "blinks" , "pause" variables, proceeds blink , pause.
7. delay 5000, repeat.
i'm pull out o-scope see if can troubleshoot more.
thanks help! apologize in advanced poor spelling in comments.
i have application establish 2-way communicate between 2 arduino nanos using i2c using "easytransfer". easytransfer comes i2c library, when trying establish 2-way communication using failed opened library , can tell library did not support this. posted message on author's website here: http://www.billporter.info/forum/topic/easytransfer-i2c-two-way-communication/#post-2641
what lead me believe 2-way communication had not been worked out fact easytransferi2c::senddata contained code specific sending data master slave , receivedata contained code specific receiving data master slave.
my solution modify library , make i2c_address inputs ::senddata() , ::receivedata() optional. if input supplied, assumes master -> slave communication. if no input supplied code assumes slave responding master request.
attached library , code. think i'm close, master -> slave communication working properly. example code expansion of original example code. here gist of processes (how should work):
1. master declares random "blinks" , "pause" variable
2. master sends slave data
3. slave receives data, blinks , pauses led_indicator based on data
4. master requests slave send data it
5. slave send "blinks" , "pause" variables
6. master receives "blinks" , "pause" variables, proceeds blink , pause.
7. delay 5000, repeat.
i'm pull out o-scope see if can troubleshoot more.
thanks help! apologize in advanced poor spelling in comments.
from can tell o-scope , adding "serial.print" debug lines in library code, thing slave transmitting value 255, 6 times...
not sure why....
not sure why....
Arduino Forum > Using Arduino > Programming Questions > EasyTransfer-I2C 2-way Master<->Slave Communication
arduino
Comments
Post a Comment