Avatar for user104966


Member since Nov 2019 • Last active Nov 2019
  • 1 conversations

Most recent activity

  • in Other Boards
    Avatar for user104966

    I just tried BTN1 and BTN2 , that has sorted that problem. I will see if I can change the documentation here

    That just leaves the "block code" issue.

    Thanks for replies, I will have to look at java script so I can better understand the documentation you pointed me at.

  • in Other Boards
    Avatar for user104966

    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.