Avatar for Raik

Raik

Member since Dec 2019 • Last active Jul 2020
  • 10 conversations
  • 103 comments

Most recent activity

  • in Bangle.js
    Avatar for Raik

    Hi Mat,

    sure, connect the WebIDE, then in the REPL (left side) just type something like

    GB({"t":"notify","src":"test","body":"te­st"});
    

    That will trigger the GB function from GadgetBridge.

  • in Bangle.js
    Avatar for Raik

    As suggested here, maybe it helps to activate Packet receipt notification procedure and/or lower the number of packets (default is 12, see this link).

    To adjust, go to nRF Toolbox -> DFU -> 3 dots top right -> Settings

  • in Bangle.js
    Avatar for Raik

    Ah, i'm now thinking maybe it doesn't have that component?

    Most likely this will be the case. The company that manufactured these didn't do a very good job with QA or didn't even care.

    That's why there is an option in the settings (beep->vibrate) to use the vibration motor for audio, though it is not as loud. On the other hand, the piezo probably wouldn't have been significantly louder.

  • in Bangle.js
    Avatar for Raik

    You mean this one? http://forum.espruino.com/conversations/­349399/#comment15351284

    Maybe @Michaelnik can provide some code.

  • in Bangle.js
    Avatar for Raik

    what OS is your phone running?

    Android 8.0.0

  • in JavaScript
    Avatar for Raik

    Hi,
    I am not JS expert, but I think it all comes down to the way the Web IDE handles your script as @fanoush already mentioned. The code gets executed line by line as it gets uploaded. You can clearly see this when you hit upload, then change to the left side of the editor and hit the up arrow button to show the executed command history.

    Here is your first example with added timestamps:

    setTimeout( function(){console.log("nope "+getTime());},0);
    console.log("yep "+getTime());
    console.log("yep "+getTime());
    console.log("yep "+getTime());
    console.log("yep "+getTime());
    console.log("yep "+getTime());
    var dontgetit = 345;
    

    Output:

    >nope 1592558510.36899995803
    yep 1592558510.37299990653
    >yep 1592558510.37599992752
    >yep 1592558510.38100004196
    >yep 1592558510.38400006294
    >yep 1592558510.39000010490
    

    You can see that nope was written earlier than the yeps. Now let's wrap this in a function and call the function to execute it as a single block:

    function test() {
     setTimeout( function(){console.log("nope "+getTime());},0);
      console.log("yep "+getTime());
      console.log("yep "+getTime());
      console.log("yep "+getTime());
      console.log("yep "+getTime());
      console.log("yep "+getTime());
      var dontgetit = 345;
      return dontgetit;
    }
    
    print(test());
    

    Output:

    >yep 1592559009.20099997520
    yep 1592559009.20099997520
    yep 1592559009.20199990272
    yep 1592559009.20300006866
    yep 1592559009.20300006866
    345
    nope 1592559009.20700001716
    

    You see that the nope now is being executed last, even after printing the result of the function. Maybe you can run your other tests in a similar fashion and it will clear things up for you.

  • in Bangle.js
    Avatar for Raik

    Hi,
    reset is a reserved function name. Try a different argument name like this

    E.showPrompt("Reset the score\nto 0-0?").then( (res) => {
          if (res) {
            this.game.resetScore();
          }
          this.activateGameButtons();
        });
    
  • in Bangle.js
    Avatar for Raik

    FYI: same happened to me when upgrading to v2.06.
    I did the usual: download zip file from espruino.com/download on my phone and used nRF Toolbox.
    I didn't pay attention to it sitting next to me because for the previous time that worked fine.
    When I looked at the watch a minute later it show the same error message from OP.
    So I tried again and it stopped with an error at 2%.
    Error messages where something of the line of "Invalid parameter" and something else. I tried a couple of times without success.
    What eventually helped was switching BT on the phone on/off again.

  • in Bangle.js
    Avatar for Raik

    Good article, very cool to see the dotmatrix clock and the calculator app in the pictures. I think it's just awesome being a part of the community! :-)

  • in ESP8266
    Avatar for Raik

    What router model are you using?

    Can you change Personal to PSK (pre-shared key)? Or is there only an option to switch between Personal and Enterprise?

Actions