This is my simple setup

This is my test program, using nodejs and rpi-gpio.
Code: Select all
var gpio = require('rpi-gpio');
gpio.on('change', function(channel, value) {
console.log('Channel ' + channel + ' value is now ' + value);
});
gpio.setup(36, gpio.DIR_IN, gpio.EDGE_BOTH);Code: Select all
Channel 36 value is now true
Channel 36 value is now true
Channel 36 value is now trueCode: Select all
Channel 36 value is now true
Channel 36 value is now true
Channel 36 value is now true
Channel 36 value is now falseThere are a total of 3 switches and all of them are working normally, tested with a multimeter. It is not a switch issue because I see the same behavior across all of them.
Something that may be worth mentioning is that the distance between A and SW1 is about 4 meters. And that's also why I'm pulling up, as I can't move SW1 physically and there is already ground there, this way I'm saving 1 cable of about 4 meters.
I'm missing something which is probably really silly, but oh well..
Oh and I'm aware there are internal pull-up resistors but I'd rather use external ones.