It's a bit raw for now but that's how it looks like right now, ready to be done as a module.
I do have a question for @Gordon , I had to use promises because I needed to wait a few ms for the sensor to be ready after setting the pointer for the read (otherwise I get an I2C exception). There isn't any ready pin for this sensor.
Would promises be the way to go, or is there some other way to "delay" the I2C read but still maintain a somewhat sychronous flow?
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.
I wasn't able to get @Alexandr 's code give the correct values so I tried doing it differently.
I tested the sensor with an Arduino and a library for the HDC1080 and then transferred the whole shield over to the Pixl.js for testing.
It's a bit raw for now but that's how it looks like right now, ready to be done as a module.
I do have a question for @Gordon , I had to use promises because I needed to wait a few ms for the sensor to be ready after setting the pointer for the read (otherwise I get an I2C exception). There isn't any ready pin for this sensor.
Would promises be the way to go, or is there some other way to "delay" the I2C read but still maintain a somewhat sychronous flow?
Edit: obligatory screenshot'
1 Attachment