Most recent activity
-
you can monitor RX pin with setWatch (with input pulldown) and when it goes up you reconfigure it as serial, I had it like this on DS-D6
https://gist.github.com/fanoush/ce461c73c299834bcb53a615721b5a2e#file-dsd6-js-L234You could also have pull up and monitor when it goes low if the serial is permanently attached and the pin is high but first character may be lost, which is still ok for console if you first press Enter and wait a bit.
For ds-d6 I went with first option so console was enabled when I plugged it into usb female attached to usb serial adapter.
-
-
-
That was one of the things that was specifically called out in Pebble development. The display was updated a horizontal row at a time, and a whole row had to be sent. So even if you were only updating a rectangle 10 px high by 3 px wide, you'd still have to send the entire 10 rows
Yes, that is true also here, display is updated in whole lines. Framebuffer is in RAM, pixels are updated as needed, then at flip() time whole area between min and max modified Y coordinate is sent from RAM to the display (3 bits per pixel - 66 bytes per line).
And the display's power consumption increased dramatically when updating.
the watch has LPM013M126 display, found two datasheets for A and C versions, both have same table on page 9
https://www.j-display.com/product/pdf/Datasheet/4LPM013M126A_specification_Ver02.pdf#page=9
https://www.j-display.com/product/pdf/Datasheet/5LPM013M126C_specification_ver03.pdf#page=9Both values (no update vs data update) are very very low (116uW=~40uA at 3V absolute maximum or 10/3=3.3uA typical).
CPU draws 4mA when not in sleep, SPI DMA transfer draws about 1mA (CPU can sleep) so both drawing and sending data takes far more power on CPU side.
datasheet says max SPI frequency is 2MHz (page 10), we use 4 here https://github.com/espruino/Espruino/blob/master/libs/graphics/lcd_memlcd.c#L401
=500KB/s, whole display is 11.6KB so about 23ms (at ~1mA) to send over SPI (or 0.13ms per line)I'd guess the javascript code to compute and draw anything to framebuffer takes more than 23ms .
Maybe on Pebble if the drawing code is native then updating screen over SPI may take proportionally more time than producing the change as the SPI frequency is quite low. But in both cases it is the nrf52 chip that consumes most of the energy here, not the display.
But still for the whole watch it can be said that "power consumption increases dramatically when updating the screen" because otherwise everything sleeps most of the time. Well, unless you have backlight or GPS turned on :-) https://www.espruino.com/Bangle.js2#power-consumption
-
button press is taken by first unlocking and second entering menu. Not sure you get touch event when input is locked but after pressing button to unlock you should get the touch event when screen is touched.
Yes. However I guess it is not the display itself that consumes that much power on update it is the CPU wakeup and activity to produce something drawable before sending the result to display, here it is also the JavaScript interpreter that takes milliseconds to execute even few lines of code.
-
My first thought was that bangle was keeping files read from strorage (which I do in "loadRoute") in memory
Storage.read
returns just pointer to flash. However RAM is used once you start manipulating the data (like reading short blocks from storage and concatenating them) so sometimes it may be better to 'read' whole file at once and just iterating over the big string or array than reading in small chunks and possibly joining them back. so depends on your loadRoute code whether it ' was keeping files read from storage in memory' . If it was just iterating over it there is no data to garbage collect.Also the interpreter is running code directly from flash not using RAM. Unless you upload code to RAM, then it of course needs more RAM for storing uploaded code.
-
Strange characters also appear on the serial monitor
this is caused by incorrectly set baud rate on COM port, installed firmware is using different speed than you set there (9600 in bottom right)
I think the software it came with is damaged.
no, not 'damaged', it is no longer there at all, you overwrote it by installing other ones on top of it, and there is probably no point in installing it (and we can hardly guess which one it was)
If you want to use Arduino I'd start from scratch and follow some tutorial like https://techtutorialsx.com/2016/02/28/esp8266-uploading-code-from-arduino-ide/
Also for Arduino issues it is better to ask in some Arduino forum, not here
-
Shame no1 linked to it (and I wasn't able to find it) when I was asking about which version of javascript Espruino is based on.
You got that link right here https://forum.espruino.com/conversations/388506/#17058616 when you asked :-)
-
Where does the changed code for (change #1) now live. Is it in my forked repository ?
yes, the PR is based on branch in your repo that you want to merge to upstram repo so any change in that branch goes to the PR. I think there is no other way for changes done by others so you need to pull that branch and possibly merge those changes back to your local repo before you can push more changes
Can anyone show me where the 'Update' button is on a github repo.
not sure I understand but there is sync button on the branch
it is interpreter, compilers are supposed to compile, not manage runtime memory
Just tried slice, splice, shift and also pop, at least in simple cases it works
check
usage
, goes up and down as expectedFor me good and stable app is not bloated app that runs slow (=drains more battery) and needs lot of memory.
This is debatable. Smaller code without unneeded abstractions can be easy to maintain and extend too. Someone else may see your perfectly testable and extensible code hard too. Also the size of typical watch app is not that big and people write it for fun and for free so extendable and maintainable may not be even the goal here.