-
Will do, but I'm not sure it's ready yet. I'd like to get the Lux calculation done, plus verify that the main code's working correctly as I'm still not getting a reading off the infrared channel, even after I double-checked the code against the original datasheet.
EDIT: Well, I guess it doesn't need the Lux calculation, but I'm still concerned about the infrared readings. Incomplete is one thing; broken is another matter entirely.
Tom
-
Following up on this thread... there's an issue at https://github.com/espruino/Espruino/issues/211
Incidentally, I've refactored the TSL2561 code somewhat and fixed a few bugs. It should use memory more efficiently now. https://github.com/tomgidden/espruino-misc/blob/master/tsl2561.js
-
-
-
Of course there needs to be a delineation between public constants needed for configuration (eg. tsl.C.address.FLOAT) and private constants used internally.
Alternatively, to use a better way of configuring than using a bunch of pseudo-enums.
BTW, one thing I did notice (but didn't have time to investigate last night) was the problem of chaining calls, eg.
obj .init(foo, bar) .setFoo(1) .getValue(function (val) {...});
rather than individual statements. The interpreter (or IDE... can't remember which) seemed to bork on the syntax.
-
Yeah, sure... I'll do a pull request if #kai or someone else can help test it with another sensor. I've also got a barometric sensor and a humidity/temperature sensor to do the same way.
It'd be nice to get the usual popular Adafruit etc. breakout sensors ported, especially if done to a reasonably consistent API.
Tom
-
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
-
-
That's a good idea... I was planning to open it up to add a momentary button for the LEDs anyway.
I'm guessing the relationship between solar cell output for typical light level over 24 hours at various times of year, vs. charger/battery efficiency, vs. power drain by the Espruino (plus other drains, such as wireless modules) would be a pig to figure out.
Any rough guesses on whether the solar cell kept in daylight charging up the Li-Poly battery would be enough to power the Espruino with a typical(!) activity load in perpetuity?
-
Probably not exactly what you were thinking of, but I bought a 10,000 mAh battery pack with solar panel the other day specifically for running an Espruino. http://www.amazon.co.uk/gp/product/B00DNX3OQI
Unfortunately, this particular one is stupidly designed with the blue power-level indicator LEDs lit at all times while it supplies power to USB, rather than momentarily when a "test" button is pushed. No idea how well it'll work, but I've got an Espruino running off it at the moment. It's not a particularly fair test considering how little sunlight it's getting right now.
-
(Ugh.. this is actually "tomgidden", but I still can't get my browser to log me in reliably, and it looks like the cookie's expired. Oh well. Call me user6351.)
I've been trying to get the CC3000 running as an HTTP server using the example code, merging the CC3000 setup code with the HTTP server code:
var wlan = require('CC3000').connect(); wlan.connect("MY_SSID", "my_wpa_key", function (s) { if(s == 'dhcp') { console.log(wlan.getIP().ip); require('http') .createServer(function(req, res) { res.writeHead(200); res.end("Hello"); }) .listen(8080); } });
The connection initialises fine, and after a while, I get the "dhcp" followed by the IP address. I can also connect to the port from a remote machine, via telnet/nc and curl. However, nothing after that. Eventually curl will timeout. Best I can do is hit RST and start again.
Any thoughts?
(This is on firmware 1v46)
Hey,
What's the chance of getting Espruino running on nRF51822? It's a tiny ARM Cortex-M0 with 256kB flash, 16kB RAM, and most importantly, built-in Bluetooth LE. Found in Estimote, RFduino, most iBeacon things, and also a lot of fingernail-sized boards on eBay for £5'ish.
I'm a newbie when it comes to hardware-level stuff, so I have no idea how practical this would be, but I expect it would fall on this spectrum:
My guess is probably Point (1).
Anyway, I figured it was worth asking, as it's a nice little thing but I'd far prefer to be programming it with Espruino than messing about with gcc-arm-none-eabi and a Segger!
Tom