• Hi Bert,
    I think you have another option on the approach with the mpr121 that avoids polling.
    The chip and the breakout boards usually have an interrupt pin that will trigger an output when ever one of the switches is touched.
    If you wire this to an input pin on the Expruino then you can use a setWatch function to execute a function to read the mrp1.touched function.
    https://www.espruino.com/Reference#t_l__­global_setWatch

  • Wed 2021.09.22

    'another option on the approach with the mpr121 that avoids polling'

    I like that post #11 suggestion @SimonGAndrews and although I haven't measured, I believe that technique also extends battery life, as Javascript isn't continuously executing as a result of the setInterval duration.

  • That is a useful insight! The device I'm working on will be plugged in via USB the whole time, but future projects might be portable... thank you!

About

Avatar for Robin @Robin started