-
-
-
-
I use it, but i believe the api would change for the better with your planned changes, so no probs.
Only thing, I believe that either I don't understand something, or there are two problems with the current code/docs
1) The docs say that h,s,v should be 0..1, but I found that keeping h within that range only gives blue. Using something between 0 and 360 works a lot better.
2) I tought the resulting color should be hue modulus 360, that is, 361 should be equal to 1, and instead it flashes purple around 361, I can't tell you exactly at what point because I don't have it around now.
Bye -
-
-
-
-
-
-
You should not write SerialN.on('data2'... ) beacause there is no such message. All serials can register a callback on the 'data' event. then the variable 'data' (which is a different thing from the name of the event) is local to the function, so no need to call it differently.
So, what i mean is:
Serial2.on('data', function(data) { console.log("Received " + data + "on serial2") }); Serial3.on('data', function(data) { console.log("Received " + data + "on serial3") });
should just work.
-
-
Yes, your intuition is good. The first three bytes control respectively Red, Green and Blue for the first led, the second three do the same for the second, and so on.
I'm also developing some stuff by controlling leds, something that could be best defined as a software defined lamp; Depending on what you actually want to achieve, you could be better off using the graphics library (useful if you need to draw a line or something like that);
I suggest you attempt to do something on the espruino command prompt, I love it because it allows for very rapid prototyping and gets you going quick.
I include the file I'm working on; Probably not all of this is working, and some comments are in italian, but you could draw some inspiration as I use a few different ways of accessing the led array.
Bye
Luca -
-
-
Well don't tell Gordon ;) but the first thing I'll do when I get my microPython will be compiling Espruino on that. And maybe the opposite too, just for the heck of it!
Actually, the best thing in the world would be to put the STM32 on a socket of sorts, so that you could pick the best suited to the job. -
That modulizing thing sounds very good to me, particularly if done at a low level (i.e. getting or not getting compiled at all!). For instance, I'm temped at writing (well, porting actually) a driver for the ENC28J60, and it's probably going to be quite a lot of code - not the driver itself, but the tcp/ip on top of that. Also there's other bits which aren't used in all projects (Waveform comes to mind).. so yeah making it possible to pick which parts of Espruino get included would be a very good idea. Trouble is.. I haven't had much luck so far in setting up a toolchain to cross compile the thing on osx (but I've seen a few posts here that could help)
-
-
-
If you can afford something simplier, I would adapt http://www.espruino.com/Single+Button+Combination+Lock - It's just security trough obscurity, but a lot easier to implement (reenable the console when the right sequence has been pushed)
I agree with Gordon about not bothering much with security anyway, I don't think password protecting the console would be generally useful. -
-
prop mounted leds are the coolest though!