• Thinking about it, analogRead may be a bit of a bad start... I seem to recall that moving to reading analog values removes the pullup on STM32 devices.

    I've just looked up the IO pin characteristics again, and I get the attached. It looks like you're just on the edge of the acceptable input voltage for a 0 reading at 1v. Please could you try using a lower value resistor for the pull-down? You've got 47k at the moment, but something like a 33k or 39k resistor might just get the voltage down enough that a '0' was registered.

    It's odd because it had worked for me, but there's some variance in all the components and I guess this time it was just too close to work... If it works I'll update the resistor values in the docs.

    When you get that done, just try something simple like:

    pinMode(A5, 'input_pullup');
    setWatch(function(e) { console.log(e); }, A5, { repeat:true, edge:'both' });
    

    1 Attachment

    • Screenshot at 2017-08-02 10-35-16.png
About

Avatar for Gordon @Gordon started