Avatar for allObjects


Member since Jul 2014 • Last active Jul 2021

Espruino makes IoT as easy as 123!

Most recent activity

  • in Projects
    Avatar for allObjects

    @NoobJS, it depends what the callback has to do... 14000 / 60 = 234 events per second... You can try...

    The setup for doing something like that is usually a bit different: a counter is connected to the pulse sensor and is made to measure for a calibrated time. The counts are then translated into RPM. Checkout this https://www.espruino.com/STM32+Periphera­ls out.

    With the setWatch() you may try by making sure nothing else is eventing and watch only for a given time.

  • in Projects
    Avatar for allObjects

    Watched you clip...

    I think the measuring cycle and the display cycles and processes should. be independent / asynchronous and 'virtually' simultaneously, both triggered by their own intervals or interval and timeout, and any rendering to the display should happen only if data has changed, with once a while a display of data that has not been displayed for a while. With that in place you get the best out of both model/data and view worlds.

    For simulation, you can take a second board with which you produce the events and values for the first one.

    You can also use the Testing and Monitoring feature built into Espruino Web IDE to not only drive your board but also monitor it, display behavior in a graph with lines and even record the monitor results. In settings enable the Testing feature and setup some testing configurations.

  • in General
    Avatar for allObjects


    BTW, could it be an option/help/possible to use prettier for selected code only ?

    from @JumJum is very useful. Because often I use human formatting rather that machine formatting for the code to have a better visualize for repetitive source lines (such as lines 13 thru 27 in first code block in post http://forum.espruino.com/comments/13218­059/ - part of the conversation about Modular and extensible UI framework and ui elements.).

    To go a step further, I'd suggest to add a directive (as JS comment) that turns it off and on again, so the manual selection and formatting falls away. No matter what on formatting the whole file, the section(s) marked stay(s) untouched where as all other areas are formatted.

  • in Projects
    Avatar for allObjects

    Excellent! I like it a lot... quite a while back I built a GPS display - DIY Marine GPS using enhanced GPS Module, u-blox NEO-6M GPS receiver, and ILI9341 Module controlled 2.8" Color TFT LCD after Exploring 2.8" Color TFT Touch LCD by Pac Man Game attempt.

    You have to get creative to overcome the speed issues... doing graphics over a serial line is challenging.

    For the GPS, I update only stuff that has changed, and in the pac man game I used just two lines to animate the 'eater'.

    Since you deal you can also use fixed fonts rather than vector fonts and scale them... it is a bit jagged then, but it is much faster. Drawing and filling is the challenge.

    There are also parallel controlled displays out there... they are much faster, but you have to sacrifice GPIOs...

    Bangle.js is 8-bit parallell serial...that is the reason it's displaying much faster.

    Totally different path is to use segment displays rather than dot displays. Dot displays are always slower... and 'high'-resolution display are worse, because of use of so many dots.

    Take a look at Large Display: x by y w/ 24 bpp Graphics buffer visualized with neopixel string in zig-zag layout. There I use neopixel - serially controlled - but use Espruino's Graphics capabilities:

    • The application writes to a graphics object using the convenient graphics features
    • A background process updates the display by just reading out the buffer of the graphics object and 'shoving it down the throat' neopixel string.

    You find all kinds of display projects among my Espruino forum posts...

  • in Pico / Wifi / Original Espruino
    Avatar for allObjects

    nope... the HW is not setup / wired for it.

  • in ESP8266
    Avatar for allObjects

    ...very self explanatory! Thanks for sharing.

  • Avatar for allObjects

    @bigplik, you are talking Espriuno MDBT42Q breakout board?

    ...that's why I usually by 2 or more things at once if they do not cost a fortune... Looking and checking twice and still connecting the wrong way or a powered wire (pulls and) brushes over the setup is something possible to happen. Sorry for that it happened to you (too).

    I'm not sure you really want to pin the failing of transition from Arduino to Espruino ecosystem... At worst I would consider it a delay...

  • in ESP8266
    Avatar for allObjects


    you should be able override it just like that var LED1 = NodeMCU.D2; to put NodeMCU.D2 on LED1 (or just any other (var) name). Since it is a pin, it 'understands' .set() and .reset() and all other pin related 'methods' as documented in https://www.espruino.com/Reference#Pin documentation. Since Espruino boards have the LEDs known and (may) preset pin mode, you may need to do that too with the assignment, such as pinMode(NodeMCU.D2,"output"). --- Let us know if it works... your board's built-in LWD - if there is one on any of the pins - or to which pin you will connect the LED w/ resistor - will define the code detail.

  • in Bangle.js
    Avatar for allObjects

    I like that very much. What about position and color? I know about to make it lightweight as possible is a goal, but it should not be too limiting. First thing I notice is that position, length, color follow some rules which are for me a bit too limiting.

    More later. Based on experience gained in https://www.espruino.com/ui (UI Framework for microcontrollers) - no visuals yet (my bad) - based on Modular and extensible UI framework and ui elements. with a lot of visuals - work that started 5+ years ago with last updates less than 2 years ago and was developed in an emulator in the browser... - I would say that layout should not go as crazy as that but presented specs are a Byte(! - not just a bit) frugal.

    What I also can say that layouts need to be hw oriented... otherwise complexity ends up comparable with a (graphical) Web browser... and I would consider those be the most complex applications ever exist(ed).

    PS: @MaBe worked recently thru some layout design and implementation exercise and may spare a cent or two on this... (sorry @MaBe, squeezing even more out of the already time-emtpy 24h day-lemon - :\ ).

  • in JavaScript
    Avatar for allObjects

    To get you logging out of the request memory scope, you could create a valueObj for the data to log - var valueObj = { p1:v1, p2:v2, ...} and then do the logging deferred with setTimout(function(valueObj){<logging code; >},<timeoutTime>,valueObject). This may for a short time use a bit more memory but all communication transaction held resources get released earlier. The timeout time has not to be a real defer, it is there to break the execution flow