Avatar for allObjects


Member since Jul 2014 • Last active Oct 2019

Espruino makes IoT as easy as 123!

Most recent activity

  • in Pico / Wifi / Original Espruino
    Avatar for allObjects

    It'll be drawing under 40mA...

    This is a good average for high drawing with output pins just driving input pins with only (very) high input impedance of other things.

    If you though drive lower impedance inputs / loads - and LEDs (can) already fall in this category, or even driving other devices' power as done in this application about GPS powered by Espruino pin(s) - you may rethink -and do current budgeting.

    Taking a look at the chip's specs at http://www.espruino.com/datasheets/STM32­F401xD.pdf , section 6.2 Absolute maximum ratings (p. 58+), Table 12. Current characteristics (p. 59), the chip can draw max 160mA, with I/O pins driving capabilities is 25mA, but sink and source by I/O pins combined is not to exceed 120mA (to stay within voltage spec levels for solid high and low).

  • in Pico / Wifi / Original Espruino
    Avatar for allObjects

    Since decent 12V to USB 5V converters are readily available, I would put one in between car battery and Pico. Reason is that - depending on what you drive with the Pico pins and what else you 'hang onto the Pico's .3V output - the Pico onboard voltage regulator may heat up... after all, with 14.4 Volt - typical for a running engine - and a 250mA current you convert 3.7 Watts into heat. If you let the 12V to USB 5V converter do the heavy lifting ('destroying' power / converting power to heat - up to 3.275 Watts), it will only be 0.425 Watts left for the regulator of the Espruino to 'dispose'.

  • Avatar for allObjects

    ...there 'was once' the Read Bear DUO IoT board... and it was 'wildly' praised to have (also) JavaScript support - and it had it 'mildly' - just to rhyme w/ 'wildly'... but the guy never really followed thru after a start w/ 1v86 lest kept up... he used it only as a marketing tool in a cheap way... readbear also moved/was sold/got taken over/disappeared (products are discontinued), so I do not know if I ever would move towards that platform (see https://www.dfrobot.com/product-1586.htm­l - if that url is still up - github is though still there - https://github.com/redbear/Duo - but has a lot of dead links, and so do google search results).

    You follow best @Gordon suggestions... Espruino-Wifi is a very strong platform and has the means to do SSL / HTTPS (because it has sufficient memory for handling/holding certificates) - and pair it up with some BLE solution... any Espruino BLE will do excellent, because you have then not to worry to get resource constrained while communicating (3(+) cores). Communication issues are the worst and most difficult to resolve.

  • in Projects
    Avatar for allObjects

    ----- 2019-09-30 Update -----

    Espruino Pixl makes its debut the ui framework... see the Preview in ---> post #18.

    From #post 18, download, unzip the attached zip file with the _sbx Sandbox folder, make Espruino Web IDE point to this sandbox folder and load the uiExamplePixl.js project file.

  • in Projects
    Avatar for allObjects

    ----- 2019-09-27 Update -----

    As new extension module has been added: support for control with watched push buttons rather than with touch screen - see ---> post #17 . Same time, the keyboard, the input fields and the uiExt extension got some enhancements, last but not least to support watched buttons to drive the ui. So far all but the sliders can be used - with three (3) buttons it is very comfortable: two (2) buttons to cycle forward and backward thru he ui elements and the third - 'Enter' / Tap - button is for tapping. Timing the tapping - how long the push button has been pressed and passing it when calling the tap selected ui element - .ts(...) - gives access to also the timed functions:

    • short tap / touch / press the button: < 140 ms
    • medium tap / touch / press the button: 140..450 ms
    • long tap / touch / press the button: >450 ms

    The input field has a callback that checks tap time, and when it is more than 550 ms, the input field is cleared. The delete x in the top right corner of the input field is part of the ui element and not one of its own, so it cannot be reached with cycling through the ui elements. Having separate buttons for navigation / 'moving' the selection and the action tapping makes operation safe. Increasing the time for clearing the input field to make it distinctive from cycling backwards with a long press.

    Other, non-functional changes is the renaming of the example: replacing the DspTouch infix in the names with just Example provides room the examples to also include button operation vs touch operation. Both can be used simultaneously... (with one caveat: touchscreen tapping does not preserve the visual cue what ui element is selected at times.

    Updated zip file is to be found in --->post #7 .

  • in Projects
    Avatar for allObjects

    ----- 2019-09-24 Update -----

    Finally some rework and review round trip completed to share things that had its design in 2015, some rework in 2016 and 2017 and just now.

    After this, read up from ---> post #7 on.

    Reviewing and getting code and some doc ready for pub did not go without some enhancements and adding a few vars to the foot print.

    Event categorization with flags and handling got a significant lift to give more control to the user and application. Also the slider got a technical as well as a face lift. Some issues got resolved, such as ui elements changing unintended their values by just dragging over them.

    Input field is still a bit bare bones and kept as such... last but not least because of slowness of (communication to) most displays. Have to come up w/ some enhanced version... being a different ui element 'clazz' though to keep the simple version with small foot print.

    The general idea of publishing in this conversation is to get it out and get feedback. Over time these posts will change including the zip file uploaded in post #8 with all the code - modules, examples and cross development components (on functional changes). Old versions will be kept there as long as possible.

    After a while things will move into regular site's modules folder and into module and tutorial pages.

    Cu after reading up from ---> post #7 on.

  • in Projects
    Avatar for allObjects

    ui varia 3 - tbp

  • in Projects
    Avatar for allObjects

    ui varia 2 - tbp

  • in Projects
    Avatar for allObjects

    ----- varia ----------- DisplayUiEltWithCumstomFormatter.js

    *** Varia: Diaplay ui element with custom formatter

    Custom renderers / formatters may take ui and touch states / flags into
    account in their logic. This can cause interference issues when using
    ui's display function on element: ui.d(e). Issue is that sometimes
    the renderer / formatter works, and sometimes not.

    There are three (3) options for a solution:

    --- Setup

    The ui singleton (framework)

    var ui = require("ui")  // UI singleton holding slider s2 (below)
    // ...

    slider "s2" kept held onto with variable s2:

    var s2 = ui.c( 3,"sli","s2",... // slider - uiSli - w/ custom formatter taking ui / touch event
         // states / flags into consideration in logic
         // function(v,_) { if (_t.te.f... ) { ...

    For more details see instructions in ui, uiBtn and uiSli modules.

    --- Options

    • option 1

    // option 1 - where no touch event is ongoing and flags f has to keep state:
    //   set touch event flags all to 0 before invoking display of ui element
    ui.te.f = 0; ui.d(s2); // display value label of slider
    • option 2

    // option 2 - where touch event is ongoing but flags f have to keep state:
    //   backup flags, set all to 0 or as desired, invoke display AND restore
    var fs = ui.te.f; ui.te.f=0; ui.d(s2).te.f=fs;
    • option 3

    // option 3 - use additional control flag
    //   introduce a flag yourself 'outside' / global or on ui which works as
    //   a one-shot trigger in the render / formatter function - or as in
    //   the example code below: stick it as property to the ```ui``` object
    //  (just use property name 6 or more chars).
    function(v,_) {
      if (_.myOverrideFlag || !_.te.t) {
        // ...the other stuff
    } }
    ui.myOverrideFlag=1; ui.d(s2);
    • option 4

    // option 4 - extend ui with .dWrapped(e) wrapping of .d(e) and
    // using option 2 for implementation
    ui.dWrapped(e) = function (){var fs=this.te.f; this.d(e).te.f=fs; return this;};
    // ...