You are reading a single comment by @Frida and its replies. Click here to read the full conversation.
  • If I make setWatch twice or more, I get the function double or more, when I hit the button.

    >setWatch(function() {
    :  if(digitalRead(BTN1)) {
    :    print("did");
    :  } else {
    :    print("dad");  }
    :}, BTN1, {repeat:true,debounce:10});
    =1
    >setWatch(function() {
    :  if(digitalRead(BTN1)) {
    :    print("did");
    :  } else {
    :    print("dad");  }
    :}, BTN1, {repeat:true,debounce:10});
    =2
    did
    did
    dad
    dad
    > 
    

    If I made it with this, I get a fault, because both pins, start with 1, but are different ports.

    >setWatch(function() {
    :  if(digitalRead(B1)) {
    :    print("fif");
    :  } else {
    :    print("faf");  }
    :}, B1, {repeat:true,debounce:10});
    =3
    >setWatch(function() {
    :  if(digitalRead(B1)) {
    :    print("eie");
    :  } else {
    :    print("eae");  }
    :}, A1, {repeat:true,debounce:10});
    WARNING: Unable to set watch on pin. You may already have a watch on a pin with the same number.
    =undefined
    > 
    

    If I chance that line I get the error if I made 2 with the same pin nr. in jswrap_io.c
    from:

    if (!jsiIsWatchingPin(pin) && !jshCanWatch(pin)) {
    

    to:

    if (jsiIsWatchingPin(pin) && !jshCanWatch(pin)) {
    

    But C is very difficult for me, so would it be possibly to check on the ports also?

    It can wait to after the kickstarter is over.
    It was on Espruino 1v72

    I am still chasing the fault on my stm32f3discovery.
    I am a big kickstarter fan of you.

About

Avatar for Frida @Frida started