I've got a basic module for the TSL2561 luminosity sensor as sold by Adafruit done. It's pretty much a port of the Arduino library. It's not complete, and it's not fully working (which may or may not be a problem with my code or my specific sensor) but it's certainly sensing changes of light for me.
Anyway, thought I'd mention it as it shows a reasonably neat abstraction of an I2C-based sensor with an asynchronous read callback...
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.
Hey,
I've got a basic module for the TSL2561 luminosity sensor as sold by Adafruit done. It's pretty much a port of the Arduino library. It's not complete, and it's not fully working (which may or may not be a problem with my code or my specific sensor) but it's certainly sensing changes of light for me.
Anyway, thought I'd mention it as it shows a reasonably neat abstraction of an I2C-based sensor with an asynchronous read callback...
https://github.com/tomgidden/espruino-misc/blob/master/tsl2561.js
Tom