Comments (4)
A section was added to the documentation to describe the difference between interrupts and alerts. See here.
from pigpio.
Whats the difference between the interrupt and alert?
There's actually quite a big difference but it may not be immediately obvious. Take a look at the documentation for the pigpio C library gpioSetAlertFunc and the pigpio C library gpioSetISRFunc.
gpioSetAlertFunc
is used for alerts. It provides information about state changes once per millisecond so there's quite a bit of latency. However, it provides very accurate tick
information and can detect a lot more state changes per second than gpioSetAlertFunc
.
gpioSetISRFunc
is used for interrupts. It provides information about state changes as quickly as possible so there's a lot less latency than with gpioSetAlertFunc
. However, the tick
information it provides is not as accurate as the tick
information provided by gpioSetAlertFunc
. In addition, gpioSetISRFunc
can't detect as many state changes per second as gpioSetAlertFunc
.
What's the reason to not pass this tick along?
The pigpio Node.js module doesn't provide tick
information for interrupts because I decided that it's not accurate enough.
from pigpio.
Thanks, this answers my question. The latency is indeed described in the C library documentation but its easy to read over. Maybe this could be added to the documentation here to make the difference more clear in this library, because I thought I needed the interrupt til I couldn't find the tick in the interrupt event.
from pigpio.
@depuits Thanks for the feedback. Adding a note to the documentation makes sense. I'll add one.
from pigpio.
Related Issues (20)
- Electron & pigpio: gpioInitialise is not a function HOT 2
- Error: The module '.../pigpio.node' was compiled against a different Node.js version HOT 4
- Unable to use package HOT 1
- Consider relaxing restrictions in binding.gyp HOT 8
- ask for help HOT 2
- Run stepper motor for a precise number of steps.
- Error: EINVAL, Invalid argument HOT 2
- how can i read data from gps from pin 15 tx 16 rx ? HOT 4
- using pigpio with 4 motors HOT 7
- High CPU usage on Pi 4B HOT 6
- Freeze when using invalid GPIO numbers HOT 1
- Issue w/ latest Node & OS HOT 1
- Could not locate bindings file HOT 22
- pigpio.gpioInitialise() in pi 4B HOT 12
- Is SPI slave mode supported? HOT 1
- "pigpio" error Maximum call stack size exceeded HOT 2
- Unable to start pigpio on RaspberryPi 3B+ - bullseye HOT 3
- Raspberry Pi 5 Support HOT 1
- Simply not working HOT 2
- Not working with lastest Raspberry pi OS 64bits (Bookworm) HOT 6
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 pigpio.