Comments (4)
Would you be able to describe the bug? I was having a problem where wiringPiISR would continuously fire the call back and wondering if it's the same issue...
from wiringpi-node.
It crashes on node 0.12.x.
If the ISR is trigger very quickly, it's because of noises.
The ISR do not trigger on state change it triggers on voltage changes.
If the voltage drop a little a (even few millivolts) you get a FALLING event and on the opposite if the voltage increase you get a RISING event.
So you need to filter your signal, a schmitt trigger + some capacitor is a good way to filter the signal.
from wiringpi-node.
Thanks for the reply and explanation.
The issue is strange because I wasn't having this issue before and I didn't have any capacitors etc. It's only happened since I did a 'sudo apt-get update' and 'sudo apt-get upgrade'.
Now, when I run the following code:
var wpi = require('wiring-pi');
wpi.setup('wpi');
// // setup
wpi.pinMode(27, wpi.INPUT);
wpi.pullUpDnControl(27, wpi.PUD_UP);
wpi.wiringPiISR(27, wpi.INT_EDGE_FALLING, function(delta) {
console.log('Pin 7 changed to LOW (', delta, ')');
});
setInterval(function() {
console.log('waiting');
}, 2000);
This is the output I get:
waiting
waiting
waiting
waiting
waiting
waiting
Pin 27 changed to LOW ( 12908576 )
Pin 27 changed to LOW ( 979 )
Pin 27 changed to LOW ( 26 )
Pin 27 changed to LOW ( 15 )
Pin 27 changed to LOW ( 15 )
Pin 27 changed to LOW ( 17 )
Pin 27 changed to LOW ( 14 )
Pin 27 changed to LOW ( 13 )
Pin 27 changed to LOW ( 13 )
Pin 27 changed to LOW ( 14 )
It logs 'waiting' until the button is pressed. The output continues then like this, registering the delta as around 14. Before it only ran the call back once or twice.
I have an equivalent test program in python using RPi.GPIO and interrupts and that seems to work as normal, so wondering what could have caused this change...
thanks
from wiringpi-node.
Please fill a new issue, since it is not related to this one.
from wiringpi-node.
Related Issues (20)
- how to build for firmware 4.9 and wiringpi 2.4.4? HOT 4
- example for pwmWrite? HOT 3
- Got an error installing wiring-pi on alpine linux
- wiringPi.node _Z15lcd128x64circleiiiii: symbol not found under alpine linux
- Install wiring-pi on Raspberry pi 3 with Raspbian Jessie HOT 2
- Can not install wiring pi while using macOS HOT 3
- "Type Error: wpi.pcf8574Setup is not a function"
- returning from wiringPiSPIDataRW HOT 1
- Build failure: install.sh: line 28: ../../install.log: Permission denied HOT 1
- "sudo npm install wiring-pi" Does not work HOT 2
- Unable to determine hardware version: I see: hardware: bcm2835 HOT 5
- can't install wiringpi on raspy3 HOT 3
- can't install on Node.js v9.6.1
- PWM1 missing?!?
- PWM wrapper for hardware or software PWM
- Software debounce?
- Unable to build (Orange PI One)
- Can't install wiring pi HOT 13
- Please add LICENCE file in root dir
- Incompatible Pi Zero 2W?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wiringpi-node.