Avatar for AkosLukacs

AkosLukacs

Member since Dec 2015 • Last active Nov 2024
  • 24 conversations
  • 513 comments

Most recent activity

  • in ESP32
    Avatar for AkosLukacs

    Ugh, that's a lot :/
    For a new Pixl - if you don't have enough ideas already: I really like the Wio terminal, because it has a color lcd with fast refresh rate.
    On the flipside, the color LCD is of course a power hog. Any chance of a product with a replaceable display option? Low power sunlight visible and a regular-ish LCD? Something that fits in the case, so won't accidentally fall apart, but reasonably protected?
    Another annoyance: It's interface options is kind of lacking, only one I2C is available on groove connectors. The other I2C is only accessible in the 40 pin Raspberry Pi compatible connector. That connector feels like they had no idea what pinout to use... Even with the battery chassis that adds 6 more groove connectors, the other I2C is not accessible :O

  • in ESP32
    Avatar for AkosLukacs

    the Inline C / Compilation use up a bunch of server time.

    Haven't tried hosting the compiler, so no idea if it's reasonable at all - but maybe you could "exploit" the free tier of serverless offering from AWS / Azure / GCP Cloud run or Cloud Run / whatnot.
    And / or Oracle cloud's free tier - they give away a nice amount of ARM cpus for free:

    Arm-based Ampere A1 cores and 24 GB of memory usable as 1 VM or up to
    4 VMs 3,000 OCPU hours and 18,000 GB hours per month

    Or would it be worth your time to do the porting?
    And betting on these will stay really free is a danger...

    Or "just" expand like crazy, more boards, sensors and other peripherals like Adafruit or Sparkfun does. And I guess income from sold HW supports development on software. But that would most certainly require expanding to more employees...

  • in JavaScript
    Avatar for AkosLukacs

    Thank you Gordon!

    • 4 comments
    • 183 views
  • in JavaScript
    Avatar for AkosLukacs

    Looks like the pretokeniser is acting weirdly. Wanted to do some mindless blinking lights, but the code fails if I save to flash.

    My code:

    setInterval(function() {
      LED1.pulse(1,[10, 100, 10, 200, 20]);
    }, 997);
    

    The error from the Puck:

    Uncaught SyntaxError: Got function expected '{'
     at line 2 col 14 in .bootcde
    setInterval(class function(){LED1.pulse(1,[10,100,10,200,2­0]);},997);
                             ^
    > 
    

    .bootcde downloaded from the puck via the web ide:

    setInterval(class function(){LED1.pulse(1,[10,100,10,200,2­0]);},997);
    

    Output from the browser's JS console when sending (so indeed there are some tokens inside the setInterval):

    "\u0010print()\n\u0010setTime(1719600866­.884);E.setTimeZone(2)\n\u0010require(\"­Storage\").write(\".bootcde\",\"\\nsetIn­terval(\\xc2ª(){LED1.pulse(1,[10,100,10,­200,20]);},997);\",0,58);\n\u0010load()\­n\n"
    

    The same happens with the default "new tab" code too:

    // this JS
    var  on = false;
    setInterval(function() {
      on = !on;
      LED1.write(on);
    }, 500);
    

    Becomes this when saved to flash:

    class var on=class false;
    setInterval(class function(){on=!on;LED1.write(on);},500);­
    

    If I turn off the pretokeniser, it works without any problem.
    If I just send it with shift-enter, that works too.

    Web IDE v0.79.3
    Tested with Puck 1, Espruino 2v23 and 2v22 release. And nRF52840DK, built from latest. Same result.

  • in Bangle.js
    Avatar for AkosLukacs

    Or you can use Storage to store a config "file" on the device, that has the required credentials. That way you wouldn't have to put the credentials in code. Not even during development. Just read from flash. As long as the config is the same.
    You would have to create a file on the device during development. And I think the custom loader could write that file as well when installing.

  • in JavaScript
    Avatar for AkosLukacs

    Thanks!
    Using a string is even simpler, I was kind of hang up on "what number should represent the selected channel".
    A static var just feels slightly nicer looking than adding it after the class declaration.

    But now the Espruino IDE doesn't like that (see the picture)

  • in General
    Avatar for AkosLukacs

    Just an idea: there is EEZ studio, an open source platform for hardware test automation. Haven't really checked how relevant this would be for Espruino, but might be interesting.

  • in JavaScript
    Avatar for AkosLukacs

    Looks like static properties in classes are not supported?

        class Foo {
            static get CH0() { return 0xdeadbeef; }
            constructor() {
                print('nothing to see here')
            }
        }
    

    In a browser Foo.CH0 returns 0xdeadbeef as expected.
    In Espruino Foo.CH0 returns undefined. No error either, so it's parsed, but ignored / lost somewhere? It's not on the instance if you create a new instance of the class either.

    Why I want to do this? I'm writing a driver for a dual DAC, and while playing around, I found it's sort of easy to mix up the voltage and channel. Like dac.setVoltage(0, 1), or dac.setVoltage(1, 0) sets channel one to zero volts? And since this DAC (GP8403) has a feature of setting both channels at the same time, the channel parameter has 3 valid values.
    So I was thinking about some magic values as constants, that would be outside the allowed voltage range. something like dac.setVoltage(0, GP8403.CH1), and if GP8403.CH1 is outside of the 0..10V range, I can throw on invalid input, and any bug should be caught early. I know, might be overly defensive...

    Non-static getter does work. So dac.setVoltage(0, dac.CH1) works just fine.

    And of course I could define a constant, and export that as well from my module. But this approach doesn't feel really nice I guess. Or am I missing something?

    So, what would you recommend? Am I overthinking this?

Actions