![]() This callback function is called once per transmission. Now for your slave code: You are using a callback function for the onReceive event. That means you are sending 1 package with 2 data bytes in it. In your master code you are calling Wire.write() two times before Wire.endTransmission(). That means, that the transmission is done in confined data packages. The actual transmission is then done by Wire.endTransmission(). It just puts the data into the libraries internal buffer. Important information: Wire.write() does NOT send anything over the I2C lines. X = Wire.read() // read one character from the I2C Why is that Wire.write('a') is neglected? Both boards are Arduino Nano. But again, it's printing 'a' in serial monitor as per code. ![]() Then its printing 'c' in serial monitor as intended.īut, Wire.write('a') line is being neglected and nothing happens on slave board. In my case Wire.write('c') is performing the task which is assigned to 'c' in slave board.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |