Coder Social home page Coder Social logo

BOARD numbering with interrupts about rpio HOT 4 OPEN

metachris avatar metachris commented on July 29, 2024
BOARD numbering with interrupts

from rpio.

Comments (4)

mattvenn avatar mattvenn commented on July 29, 2024

same for me.

from rpio.

metachris avatar metachris commented on July 29, 2024

Thanks for the feedback. I'll be taking a look into it tomorrow!

from rpio.

chapster911 avatar chapster911 commented on July 29, 2024

Have encountered the same issue still. Oct 2013.

from rpio.

thismatters avatar thismatters commented on July 29, 2024

Still seeing this issue. I'm trying to use GPIO 25 (BOARD 22), and getting the same exception.

I've tried it out and found that BOARD pins 3, 7, 8, 11, 21, 22 Yield the 'not a valid pin' version of the exception

BOARD pin 13 gives the 'outside of range' version of the exception

The following board pins seem to initialize fine: 5, 10, 12, 15, 16, 18, 23, 24.

This is a really frustrating problem, and I don't know your code well (so forgive my presumption), but I think the evidence points to an answer.

In _RPIO.py (within the add_interrupt_callback() definition) on line 125 you translate from whatever numbering system was established by RPIO.setmode() to the proper GPIO numbers (BCM) by calling channel_to_gpio(), the exception isn't thrown there. Then on line 139 of _RPIO.py you call RPIO.gpio_function(), passing the (now BCM) gpio_id; within py_gpio_function() you take that gpio_id (which is using the BCM numbering) and you pass it again to channel_to_gpio(), this is where the error is thrown because that function expects the gpio_id to be relative to RPIO.BOARD (since that is still the set mode). Perhaps if you pass the unmolested channel_id to RPIO.gpio_function() on line 139 rather than the gpio_id it will work.

from rpio.

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.