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.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
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.