You are reading a single comment by @DrAzzy and its replies. Click here to read the full conversation.
  • setTimeout() is what you want - that way, you can have it doing other things during that 1 second, like reading other sensors, updating an LCD, etc.

    Your code is structured right, I see two issues keeping it from working:
    I2C.readFrom() needs a second argument specifying how many bytes to read.
    Data is read into variable 'data' on line 2, but call same variable 'd' on lines 6 and 9.

  • Data is read into variable 'data' on line 2, but call same variable 'd' on lines 6 and 9.
    

    And that explaines why I keep getting the error message that d is undefined. Thank you, for pointing that out!

About

Avatar for DrAzzy @DrAzzy started