Skip to main content

Timeline for I2C communication, wrong response

Current License: CC BY-SA 3.0

11 events
when toggle format what by license comment
Feb 2, 2017 at 4:55 comment added bytk @NickGammon The solar panel delivers ~3V. However after you request for the schematic again, for some reason the ground wasn't connected properly and after amending it now the display values are showing correctly already. Thank you for your help!
Jan 27, 2017 at 20:58 comment added Nick Gammon Subsequently, A0 on the slave is connected to a miniature solar panel, that I have tested and it is working - really? Can you show a schematic? What voltages is the solar panel delivering?
Jan 27, 2017 at 20:56 comment added Nick Gammon As Jot mentioned below, you are in fact sending 85 for the slave address: Wire.write(0x55). You should send: Wire.write(my_address); In my example that was not the I2C address (we know that after all) but an identifier - it was just an example anyway.
Jan 27, 2017 at 17:40 history edited bytk CC BY-SA 3.0
updated progress of problem
Jan 27, 2017 at 4:06 comment added Nick Gammon Here: sendSensor(A0);
Jan 27, 2017 at 2:02 comment added bytk @NickGammon for this case I would like to know for void sendSensor (const byte which) { int val = analogRead (which); in the slave code, where is the which parameter passed?
Jan 26, 2017 at 8:23 answer added Jot timeline score: 2
Jan 26, 2017 at 8:04 comment added Nick Gammon Regarding my first comment, it looks like my code that you referenced does that as well (grin).
Jan 26, 2017 at 8:02 comment added Nick Gammon I'm wondering if I have to add a "Wire.begin(8);" at the slave program setup. - you did that, since my_address is 8.
Jan 26, 2017 at 8:00 comment added Nick Gammon A possible problem is that you are doing an analogRead inside an ISR. ISRs are supposed to be fast, and an analogRead will take over 100 µs. Try doing the analogRead inside loop, and just send the latest reading in the sendSensor function. My (main) computer is currently doing an operating system upgrade, so I can't test this right now.
Jan 26, 2017 at 6:52 history asked bytk CC BY-SA 3.0