![]() The Wire.available can be used in receiveEvent, but it is not needed since 'howMany' is the number of bytes that are received. Master byte sensorNumber = 0 // first sensor While(Wire.available()) // loop through all but the last I tried several options but after many hours with no result. Only one sensor is shown by the slave arduino. ![]() I implemented the sensorNumber but the problem stil occurs. I get your point about the howMany thing. If (howMany >= (sizeof fnum) + (sizeof foo) + (sizeof x)) called by interrupt service routine when incoming data arrives I don't have any clue why this is not working in my sketch. I've changed it a little but in this setting it works. I have my sketch based on the example of Nick Gammon. I thought the numbering of the variables in i2canything would be sufficient. (sizeof THsensor2_minT) + (sizeof THsensor2_maxT) + (sizeof THsensor2_minH) + (sizeof THsensor2_maxH)) (sizeof THsensor1_minT) + (sizeof THsensor1_maxT) + (sizeof THsensor1_minH) + (sizeof THsensor1_maxH))Įlse if (howMany >= (sizeof t2) + (sizeof v2) + (sizeof THsensor2) + (sizeof THsensor2_fout) + If (howMany >= (sizeof t1) + (sizeof v1) + (sizeof THsensor1) + (sizeof THsensor1_fout) + ![]() Receiving arduino: void receiveEvent (int howMany) Sending arduino: Wire.beginTransmission (SLAVE_ADDRESS) Problem is that the receiving arduino only gets data from dht sensor 1. ![]() I use the I2C anything library to sent the data. This is temp, humidity, max en min levels of both temp / hum etc. I like to sent DHT22 data from one to another arduino. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |