You are reading a single comment by @user104966 and its replies. Click here to read the full conversation.
  • I have updated my Smartibot to version 2.04 and last night started to work through some of the examples in the documentation.

    First one I tried was button presses

    setWatch(function(e) {
      if (e.state) print("Button pressed");
      else print("Button released");
    }, BTN, {repeat:true});
    

    When I download this "Button pressed" is printed only when Button A on the smartibot is pressed, nothing when released and nothing for Button B.

    So looking at some examples I added

    var smarti = require("Smartibot");
    

    to the top and this made no difference.

    I then tried the "block" coding and used the set watch construct.
    First block was BTN1 rising and inside I change the colours of the leds. This was then duplicated for BTN1 falling, then I duplicated both for BTN2.

    Downloaded and it worked.
    Tried to change the code but somehow deleted everything, when I started again BTN2 was not available.

    This morning I started to create the post, initially the same problem , no BTN2.
    Tried refreshing the browser still did not work.
    So I downloaded the raw javascript to prove that did not detect BTNB , it did not.

    Then went back to "block" mode and BTN2 is available.

    I am using Chrome on a mac and I am new to java script.

    My questions are:

    1. what is wrong with the raw javascript code I downloaded ?
    2. have I found a bug with the block code ?

    PS should I have tagged this post or posted elsewhere so it is obvious it is a smartibot issue I am having.


    1 Attachment

    • Screenshot 2019-11-19 at 23.10.12.png
About

Avatar for user104966 @user104966 started