-
My 7 years old daughter have made (with my help) big digital clock. We use 8x32 matrix of ws8212b LED and small ESP8266 board with 5-to-3.3 V LDO on board. LED matrix have separate 2-wire power connector and 3-wire control connector, so we can connect 5V power adaptor to first one and ESP8266 to second one only (using 3 jumper wires - to GND, МСС and GPIO2).
Then very simple program convert the matrix to digital clock
var neopixel = require("neopixel"); E.setTimeZone(3); require("Wifi").setSNTP("0.pool.ntp.org",0); require("Font6x8").add(Graphics); var g = Graphics.createArrayBuffer(8,32,24,{zigzag:true,color_order:'grb'}); g.setRotation(1,1); var att=6.9; var d=Math.pow(2,att); g.setColor(0,0,1/d); var oldTime, newTime; g.setFont6x8(); function drawTime() { newTime=Date().toString().substr(16,5); if(oldTime != newTime) { oldTime=newTime; g.clear(); g.drawString(newTime); neopixel.write(D2, g.buffer); } } setInterval(drawTime,1000); neopixel.write(D2, g.buffer);
Some comments:
Last line are to fix state of LED matrix. It is enough to write first LED (even first logical LED - 1 byte) only but it is harder - we need separate (very small) buffer to do that. So we write all matrix. The line may be removed but first ouput will be incorrect.
We have found that LED matrix is in fact 8x32 zigzag (first line is right-to-left, second one is left-to-right etc.) So we have added g.setRotation() to use it as 32x8 display.
I have added att and d vars to control LED brightness more intuitively - now brightness looks to be changed linearly with att change.
It need a few seconds to get correct time from Internet, so time displayed is strange after power on. -
-
I play with LED stream and panel controlled by neopixel module.
I have tried to make home clock. I want to use use ntp-client from GitHub to get accurate initial time. I have found that it use dgram module, which is in Espruino reference but can not be connected.
I can see 'Uncaught Error: Module "dgram" not found' message.
The same happens if I try to use the module in my code.
I think may be the module is not included for ESP8266.How to add dgram support to ESP8266?
-
-
while it seems it works good with 1v94. It looks like 1v95 is too big and so writes wifi data to area with its code.
I have just bought a few ESP8266 boards and try to use them the same way as Puck.js (I have a few)
If I use 1v94 (for 4 Mb boards), it works.
If I use 1v95 or latest file in ...../master, it works too but until poweroff. It works also after turned on (not sure about every time), but only if no wifi config is saved.
If I call wifi.save() my boards stops working after power off, there are many unreadable symbols on COM port, and after reset to boot mode esptool.py verify_flash shows that area of espruino_esp8266_user1 is broken.
It looks like it writes wifi data to area with code.
By the way, it is impossible to upgrade 1v94 to 1v95 via WIFI - wiflash.sh says "Error flashing espruino_esp8266_user2.bin: firmware image too large" -
Hi Gordon,
I am new in BLE usage.
I've found (in BLE standard) something about Scan Responce requests, which may be used to send some data to BLE device in advertising mode, without connection. I think it may be useful to save battery (and may be not, depending of implementation).
Does Puck.js have possibility to receive these requests? Is it really useful to save battery compared to work in connected mode? -
-
Hi!
I'd want to change Blockly version to last one - it has many useful features (and it have much better translation to Russian, I've already backported it to current espruino-server).
last Blockly version have good interface to design custom blocks. It is critical feature to use espruino for children to study programming. I want to implement few custom blocks to control devices before each lesson.
Also I am going to change some Espruino blocks (like setWatch) to make it looks more usual, like event processing blocks in Scratch and Blockly games.
One problem is that last Blockly stores some data in JSON files instead of JS.
Second one is that there is no easy-to-use build system to integrate these Blocky changes to espruino-server.My goal is to combine/build some environment (boards, tools etc.) to children (my children, but not only) can program some automation and/or easy robots the same way as in Scratch/blockly games/code studio.
JS itself looks to be too hard for small children, while Blockly seems to be very good choice. Even youngest one (less then 4 years old) can solve most of code studio course 2 tasks.
-
Hi!
I have tried to use Puck.IR to control my LED Light strip.
After a few days of mining I have collected commands from remote control.
But when I have tried to write them to Puck, I have Out of memory.After I have removed few commands it starts working. But nearly full memory is used.
Is it correct? How can I reduce memory usage?
Working version looks like this:var cmd={ On: [8.97,4.42,0.58,0.52,0.61,0.52,0.58,0.55,0.58,0.52,0.61,0.52,0.61,0.49,0.61,0.52,0.58,0.52,0.64,1.59,0.64,1.62,0.58,1.65,0.61,1.62,0.61,1.65,0.58,1.65,0.61,1.62,0.61,1.62,0.58,0.52,0.61,0.52,0.61,0.52,0.58,0.52,0.61,0.52,0.58,0.52,0.61,0.52,0.58,0.52,0.64,1.59,0.64,1.62,0.58,1.65,0.61,1.62,0.61,1.65,0.58,1.65,0.61,1.62,0.58,1.65,0.55], Down: [8.97,4.42,0.58,0.52,0.61,0.52,0.58,0.55,0.58,0.52,0.61,0.52,0.61,0.52,0.58,0.52,0.58,0.52,0.64,1.59,0.64,1.62,0.58,1.65,0.61,1.62,0.61,1.65,0.58,1.65,0.61,1.62,0.61,1.62,0.58,0.52,0.61,0.52,0.61,1.62,0.61,1.65,0.58,0.52,0.61,0.49,0.64,0.49,0.58,0.52,0.61,1.65,0.58,1.65,0.61,0.52,0.58,0.52,0.61,1.65,0.58,1.65,0.61,1.62,0.61,1.62,0.58], Up: [9.00,4.39,0.61,0.49,0.64,0.49,0.61,0.52,0.61,0.49,0.64,0.49,0.58,0.52,0.64,0.49,0.61,0.52,0.58,1.65,0.61,1.62,0.61,1.68,0.55,1.65,0.61,1.62,0.58,1.65,0.58,1.65,0.61,1.62,0.61,1.65,0.58,0.52,0.61,0.49,0.64,1.62,0.61,0.49,0.61,0.52,0.58,0.52,0.61,0.52,0.58,0.52,0.61,1.62,0.64,1.62,0.58,0.52,0.64,1.62,0.58,1.65,0.58,1.65,0.61,1.62,0.61], Set25: [9.00,4.39,0.61,0.49,0.61,0.52,0.58,0.52,0.61,0.52,0.58,0.55,0.58,0.52,0.61,0.52,0.58,0.52,0.61,1.62,0.61,1.65,0.61,1.62,0.58,1.65,0.61,1.62,0.61,1.65,0.58,1.65,0.61,1.62,0.58,0.52,0.61,1.62,0.58,0.55,0.58,1.65,0.58,0.55,0.58,0.52,0.55,0.55,0.61,0.52,0.64,1.59,0.61,0.52,0.61,1.62,0.58,0.55,0.61,1.62,0.58,1.65,0.61,1.62,0.61,1.65,0.58], Set50: [9.00,4.39,0.61,0.49,0.64,0.49,0.58,0.52,0.64,0.49,0.64,0.49,0.58,0.52,0.61,0.52,0.61,0.52,0.58,1.62,0.64,1.62,0.61,1.62,0.67,1.56,0.61,1.62,0.61,1.65,0.58,1.65,0.61,1.62,0.61,1.62,0.55,0.55,0.64,1.62,0.58,1.65,0.58,0.55,0.58,0.52,0.61,0.49,0.64,0.49,0.61,0.52,0.61,1.62,0.58,0.52,0.64,0.49,0.61,1.62,0.61,1.65,0.58,1.65,0.61,1.62,0.61], Set75: [9.00,4.39,0.61,0.52,0.61,0.52,0.58,0.52,0.61,0.52,0.61,0.49,0.61,0.52,0.61,0.49,0.64,0.49,0.58,1.65,0.61,1.65,0.58,1.65,0.58,1.65,0.61,1.62,0.61,1.62,0.58,1.65,0.61,1.62,0.61,1.65,0.58,0.52,0.61,1.65,0.58,0.49,0.64,1.62,0.58,0.52,0.61,0.52,0.61,0.52,0.58,0.52,0.61,1.65,0.58,0.52,0.58,1.65,0.58,0.52,0.61,1.65,0.55,1.68,0.61,1.62,0.61], Set100:[8.97,4.42,0.58,0.52,0.61,0.52,0.58,0.52,0.61,0.52,0.61,0.49,0.61,0.52,0.58,0.52,0.64,0.49,0.58,1.65,0.64,1.59,0.61,1.65,0.58,1.65,0.61,1.62,0.61,1.65,0.55,1.65,0.61,1.62,0.61,0.52,0.64,1.59,0.61,1.65,0.58,0.52,0.61,1.62,0.58,0.52,0.64,0.49,0.61,0.52,0.58,1.65,0.61,0.52,0.58,0.52,0.61,1.65,0.58,0.52,0.61,1.62,0.58,1.65,0.61,1.62,0.58], Set1: [9.00,4.39,0.61,0.49,0.61,0.52,0.61,0.52,0.61,0.49,0.64,0.49,0.58,0.52,0.61,0.52,0.61,0.52,0.58,1.65,0.61,1.62,0.61,1.62,0.61,1.65,0.61,1.62,0.58,1.65,0.58,1.65,0.61,1.62,0.61,0.49,0.61,1.65,0.61,1.62,0.58,1.65,0.61,0.52,0.58,0.52,0.58,0.55,0.61,0.49,0.61,1.68,0.58,0.49,0.61,0.49,0.64,0.49,0.61,1.62,0.64,1.62,0.58,1.65,0.58,1.65,0.61], Set2: [8.97,4.42,0.61,0.49,0.64,0.49,0.58,0.52,0.61,0.52,0.61,0.52,0.58,0.52,0.61,0.49,0.64,0.49,0.61,1.62,0.64,1.62,0.61,1.62,0.58,1.65,0.58,1.65,0.61,1.65,0.58,1.65,0.61,1.62,0.58,0.52,0.61,1.62,0.61,1.65,0.58,0.52,0.61,0.49,0.61,0.52,0.61,0.52,0.61,0.49,0.64,1.59,0.64,0.58,0.52,0.52,0.58,1.65,0.61,1.62,0.61,1.65,0.58,1.65,0.61,1.62,0.58], Set3: [9.00,4.39,0.61,0.49,0.64,0.49,0.58,0.52,0.61,0.52,0.64,0.49,0.58,0.52,0.61,0.52,0.58,0.55,0.58,1.65,0.61,1.62,0.61,1.65,0.58,1.65,0.58,1.62,0.61,1.65,0.58,1.65,0.61,1.62,0.61,0.49,0.64,0.49,0.58,1.65,0.64,0.49,0.58,1.65,0.61,0.52,0.58,0.52,0.61,0.52,0.70,1.52,0.61,1.62,0.58,0.52,0.64,1.62,0.58,0.52,0.61,1.65,0.58,1.65,0.61,1.68,0.55], Set4: [9.00,4.42,0.58,0.52,0.61,0.52,0.58,0.52,0.61,0.52,0.61,0.49,0.61,0.52,0.61,0.49,0.64,0.49,0.61,1.62,0.61,1.62,0.61,1.65,0.58,1.65,0.61,1.62,0.58,1.65,0.58,1.65,0.64,1.62,0.58,0.52,0.61,0.52,0.58,0.52,0.58,1.68,0.58,0.52,0.61,0.49,0.61,0.52,0.58,0.52,0.64,1.62,0.58,1.65,0.61,1.62,0.61,0.52,0.58,1.65,0.61,1.62,0.58,1.65,0.64,1.62,0.58] };
and after I send it to Puck.js process.memory() output is:
>process.memory() ={ "free": 481, "usage": 1519, "total": 2000, "history": 315, "stackEndAddress": 536917896, "flash_start": 0, "flash_binary_end": 471892, "flash_code_start": 479232, "flash_length": 524288 }
-
-
I have few Puck.js devices and have not any recommended devices for WEB IDE. So I've tried to use C.H.I.P board (it is Kickstarter project, now on getchip.com) the same way as documented for Raspberry. It works!
So now I have very chip server ($9) for Puck.js devices. I think it may be good solution for many people.Some problems: Projects button does not work, espruino-server often closes with error after disconnect. But all of them are not fatal to use Puck.js.
-
Hi,
I am looking for some platform for children to go their first steps in embedded software. Espruino looks to be interesting because it have Blockly-based graphical editor. (One more reason is that I have a few big projects implemented using STM32, so it will be easier for me, but the reason is not main one).
To use Espruino for that, I need to make localization of Blockly blocks, to provide blocks with well-understandable text on native language.
As far as I know, Blockly interface generally allows that. For example, Blockly games use localized interface.
Is it possible to do that for Espruino?
And may be it is time to check power supply :)
I think, oscilloscope is usefull, too. You can check signal voltage levels etc. It is usual bug when I work with I2C. Sometimes pullups need to be changed after I2C clock change, sometimes something else happens... In fact, oscilloscope is my main tool to debug I2C.