-
-
The board must be visible during summer days as well
Visible is easy, readable is harder. Shading helps, as known for traffic lights. And more LEDs help, I'd go with 144 LEDs per meter strips, not with individual LEDs. And you'll need cooling, a custom PCB with a hole below each LED and a powerful fan in the back sucking in air from the front would help - or just don't go to 100% brightness (R+G+B) for too long.
-
-
-
Actually a remote control for a rc car, a Willy's MB (JJRC Q65). The original has 5 different light modes and a complex switch to control them. I'll to use Neopixels instead of LEDs to simulate the light modes, and could also simulate a broken light. I tested it already with a led strip, but finally I want to switch to SK6805-2427. This, however requires a pcb and reflow or hot air soldering, as these LEDs have tiny contacts.
An ESP8266 with a web server will become the receiver, to control servos, ESC and neopixels. The car (driving and lights) will be controlled over wifi with a mobile phone as controller. Finally I'll build a PCB with the ESP8266 12-F with logical level converters to 5V (needed for neopixels), but without USB port (to make it small). -
I've compiled a firmware with STORAGE enabled, but putting more and more pages on the ESP8266 it seems like there's not even 1 MB of free storage available while flash is almost 2 MB:
/* >require("Storage").getFree(); =196608 >require("ESP8266").getFreeFlash() =[ { addr: 2097152, length: 1048576 }, { addr: 3145728, length: 262144 }, { addr: 3407872, length: 262144 }, { addr: 3670016, length: 262144 }, { addr: 3932160, length: 241664 } ] */ >
Somehow I expected the STORAGE module to use all available flash storage, not just the block where the program and wifi data is stored. Is it the intended behavior, or a bug in my build?
-
So, I suspect the original problem was that the input signal was floating.
- If you connect a button only to GND (or VCC) you need a pullup (or
pulldown) resistor. (done in #10 with an internal resistor) - If you connect a button to GND (or VCC) when not pressed and to VCC (or GND) when pressed there is no problem.
- If you connect a button only to GND (or VCC) you need a pullup (or
-
Is there a bug in the souce?
https://github.com/espruino/Espruino/blob/master/libs/neopixel/jswrap_neopixel.c#L246
start = _getCycleCount(); // get start time of this bit while (_getCycleCount()-start < t) ; // busy-wait
The function
_getCycleCount()
returns ccount with is a counter increasing steady from zero to max, but once max is reached it is set to zero again. In the case ifstart
is set to max (or a value almost max) then_getCycleCount()-start
will be always smaller thant
.
I'd say a fix would be to calculate the cycles to transfer a bit, subtract this value from the max ccount giving the compare value for ccount. And if_getCycleCount()
is higher than the compare value just output low until_getCycleCount()
is zero again. Keeping the output low for the duration of a very short time (a single bit) should not affect the neopixels at all, according to https://wp.josh.com/2014/05/13/ws2812-neopixels-are-not-so-finicky-once-you-get-to-know-them/
Or any other idea? -
Gordon says 16 in http://forum.espruino.com/conversations/319081/#comment14191905 post #6.
Maybe too much memory used, maybe an issue with analog A8/A9/A10 pins.
-
@Robin: You don't want to modify the library or module itself.
const MODULE = require('module'); MODULE.foo(); //is the same as require('module').foo();
You can use a variable if you want to code like this
MODULE = require('module1'); MODULE.foo(); MODULE = require('module2'); MODULE.foo();
Happy debugging.
-
https://www.espruino.com/Reference#l_net_connect
You must place the.on
functions inside of the connect callback using the returned socket, e.g.:tcpClient.connect({port: 51325, host: "10.1.64.22"}, function(socket) { console.log("connected"); socket.on("close", function() { console.log("end"); }); });
How and if your UDP code really works is also questionable, it should be similar:
https://www.espruino.com/Reference#l_dgram_createSocket
While the example on https://www.espruino.com/Internet is exactly as you did it just doesn't correspond to the documentation.And I'd change
let tcpClient = require('net');
toconst NET = require('net');
. It's just a shortcut to the net library, not a tcpClient. -
-
-
I see where my error is. In nodejs I can load files directly from disc. In Espruino I load my files from the flash using the storage module. And this is read back as string, according to the docs. So my example was actually too short, but the hint regarding strings handling helped. Thanks.
My fix will be to pre-process the files before storing them to flash, escaping \n etc.
-
I've stripped down my code, same error:
const WIFI = require("Wifi"); onPageRequest = function(req, res) { data = 'foo\nbar\\nfoo'; res.writeHead(200, {"Content-Type": "text/text", "Content-Length": data.length}); res.write(data); res.end(); }; startWifi = function() { WIFI.connect(ssid, {password: password}, function(err) { require("http").createServer(onPageRequest).listen(80); console.log(WIFI.getIP()); }); }; ssid = "myssid"; password = "mypassword"; startWifi(); /* What I get: foo bar\nbar What I expected: foo\nbar\\nfoo */
-
Hi
I have a little web server, trying to send \n, \r, \t, \0 .
But it's being replaced newline, removed, space, nothing.While this is the expected behavior for console.log() or print() when sending this data to a client it should arrive at the client (as it does in nodejs), not being replace by something else.
-
-
Just copying the code together I'd say it should look like this:
//replace D0 const CS_PIN = D0; const CLK_PIN = D0; const MOSI_PIN = D0; var isActive = false; var d=1; var toPrint = "Got: "; //CS_PIN setWatch(function() { isActive = true; d=1; //cleanup at start },CS_PIN,{edge:"rising", repeat: true}); setWatch(function() { isActive = false; console.log(toPrint); toPrint = "Got: "; if (d!==1) { console.log("Bit error"); } },CS_PIN,{edge:"falling", repeat: true}); //CLK_PIN setWatch(function(e) { if (isActive) { d=(d<<1)|e.data; if (d>255) { toPrint = toPrint + (d&255); d=1; //cleanup after 8 bits } } },CLK_PIN,{edge:"rising", data:MOSI_PIN, repeat: true});
-
A charger for LiPo goes up to 4.2V (and more), a charger for LiFePo4 would go up to 3.6V or max. 3.75V which could be acceptable. You'd need a different charger and a LiFePo4 battery, too. And since there's no voltage regulator involved that would fail at at low battery voltage should detect low battery voltage yourself. Otherwise the chip would drain the battery until it's dead and broken.
-
Is it possible to power the board over the recharger?
Depends on the recharger. A good recharger detects the battery voltage and polarity and won't provide any power to a dead battery (0 V) or with wrong polarity (negative). It seems you have a good recharger.
When I connect it to the Bat and GND pin, it seems to work. Is this the right connection?
Yes. There is the risk of overloading your charger if your circuit draws more current than the charger can provide. If you connect only the MDBT42Q it'll be fine, but if you add a motor or 100 neopixels you might eventually overload the charger once the battery is drained.
-
-
-
console.log() takes a lot of time. If you call it once every 8 bit it's somewhat ok, but if you call it for every bit it'll slow down things significantly. But the read data should be still valid in my understanding.
For time critical functions it's better to store data you want to print in some variable or array and print it at a later point. -
@Robin: My bad, it would not hang and crash the ESP8266, but the HIGH or LOW pulse duration would be too short. Most likely resulting in a wrong color or an incomplete lit strip.