GithubHelp home page GithubHelp logo

Alert and Interrupt events about pigpio HOT 4 CLOSED

fivdi avatar fivdi commented on August 24, 2024
Alert and Interrupt events

from pigpio.

Comments (4)

fivdi avatar fivdi commented on August 24, 2024 1

A section was added to the documentation to describe the difference between interrupts and alerts. See here.

from pigpio.

fivdi avatar fivdi commented on August 24, 2024

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.

depuits avatar depuits commented on August 24, 2024

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.

fivdi avatar fivdi commented on August 24, 2024

@depuits Thanks for the feedback. Adding a note to the documentation makes sense. I'll add one.

from pigpio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.