• Hi,

    I have two switches, one connected to A1 and the other to C1.
    If I set watch for only one of the pins, it works as expected. But if I set watch for both pins, then the 2nd setWatch seem to kill the 1st.

    setWatch(onWatch, A1, { repeat:true, edge:"rising" });
    setWatch(onWatch, C1, { repeat:true, edge:"rising" });

    Is this as expected? i.e. there is limitation of pin combinations?
    I have tried some other pin combinations and "B8, B4, B3, B2" worked fine.

    Espruino 1v61

    Br, Shunya

  • Hi,

    Yes, there are some limitations documented at: http://www.espruino.com/EspruinoBoard

    But basically, you have to use different pin numbers. For instance, A0 and A1 are ok, but A0 and C0 are not.

  • Thank you Gordon for prompt clarification. I overlooked the document.

    And big thanks for your fabulous work on Espruino and Espruino board! I have used PIC and Arduino before and I love Espruino much better. With interpreter, I feel like I'm talking to the chip ;-)

  • Thanks!

    I think I have a bug open somewhere for making setWatch warn you if you're doing a watch on a second pin - I think that would make it a lot more user friendly!

  • Hi there,
    Just for my understanding, it would be ok to do setWatch on C0, C1, C2, C3, C4 and C5? So I can have 6 buttons?

  • absolutely, yes. You can go from 0 to 15.

  • Yup - to be clear, they don't need to be the same letter. They just need to have different numbers.

    If you need more than 16 buttons (or, more likely, before then) you can use a matrix keypad (search for membrane keypad on ebay - dirt cheap 1x4, 3x4, 4x4, 5x4 are readily available) with the KeyPad module.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

limitation of setWatch for multiple pin combinations?

Posted by Avatar for aerialist_user6911 @aerialist_user6911

Actions