AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Arduino two wire library12/25/2023 ![]() ![]() Its implementation uses a single set of global resources. I want to sent two different types of data on two different I2C addresses.Īrduino's Wire library is designed to have a single I2C address per device. Is there a way to get the output like this? And is there a way to fix the output from stopping after a short time? The expected output is out there, but not in a consistent way like: 5 ![]() The output I get also stops after a short time: 5 Serial.print(d) /* print the character */ function that executes whenever data is received from master Wire.begin(9) /* join i2c bus with address 9 */ Wire.onReceive(receiveEvent1) /* register receive event */ Wire.begin(8) /* join i2c bus with address 8 */ Serial.begin(9600) /* start serial for debug */ Wire.beginTransmission(8) /* begin with device address 8 */ Wire.begin(5, 4) /* join i2c bus with SDA=D1 and SCL=D2 of NodeMCU */ Serial.begin(9600) /* begin serial for debug */ I have written these two codes, they somewhat do what I expected but the result isn't consistent. Datatype 1 are integers and datatype 2 are chars. I want to sent two different types of data on two different I2C addresses. I have a master-slave setup consisting of a nodeMCU(master) and an arduino nano(slave). ![]()
0 Comments
Read More
Leave a Reply. |