It doesn't "timeout" as it seems to return in 0 microseconds with garbage data. Even tried setting a timeout and that did jack-nothing.Īlso, it doesn't even look like the LEDs on the slave are working, so I'm pretty sure there is no communication going on. I read that the requestFrom() function is blocking, but it's clearly not. However all the bytes are 255 (-1) unless I purposely actually return the 4 bytes it should be getting. The requestFrom(SLAVE_ID, BYTES) ALWAYS returns the number of bytes as the same amount I request, and Wire.available() ALWAYS shows that exact number of bytes initially requested. Then in the loop on the master I do a Wire.requestFrom(SLAVE_ID, BYTES) Here's where I'm seeing an issue: The onRequest callback does NOTHING and returns. The slave does a Wire.begin(SLAVE_ID) and set the onRequest() callback function. So to put it simply without even needing to paste code- I have a Mega 2560 as slave and Uno as master.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |