Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Listener/interrupt Not working on Version 1 Piface #28

Open
monroel opened this issue Jul 15, 2015 · 4 comments
Open

Listener/interrupt Not working on Version 1 Piface #28

monroel opened this issue Jul 15, 2015 · 4 comments

Comments

@monroel
Copy link

monroel commented Jul 15, 2015

Hello,

I am having trouble getting the simple listener examples to work. I am using latest version of Raspbian on an original Raspberry Pi board with the original (version 1?) of the piface, with Python 3.

The piface emulator works just fine on inputs and outputs, and simple input and output examples work fine as well, so I know that the code is communicating with the piface board:

import pifacedigitalio
pfd = pifacedigitalio.PiFaceDigital() # creates a PiFace Digtal object
pfd.leds[1].turn_on() # turn on/set high the second LED
print(pfd.input_pins[0].value)
0

The last statement properly prints a 1 when run while the input 0 switch is pressed.

However, when I try the following listener example, nothing works when input 0 switch is pressed:

import pifacedigitalio

def toggle_led0(event):
... event.chip.leds[0].toggle()
...
pifacedigital = pifacedigitalio.PiFaceDigital()
listener = pifacedigitalio.InputEventListener(chip=pifacedigital)
listener.register(0, pifacedigitalio.IODIR_FALLING_EDGE, toggle_led0)
listener.activate()

Have googled this and been unable to come up with anything. Do I need to explicitly enable interrupts or some other feature? Would really appreciate some help with this. Thanks!

@tompreston
Copy link
Member

Hi, your code looks correct. Are you running the most up-to-date software on your Raspberry Pi? There was a change to the GPIO pins through which we detect interrupts. Try running:

sudo apt-get update && sudo apt-get upgrade

@mschluepmann
Copy link

Same here - everything up to date

@zeppe
Copy link

zeppe commented Jan 3, 2016

I have the same problem. My program was running fine. Then I did a apt-get update; apt-get upgrade (which I did not do since 2014) and interrupts stopped working.

@Brewj
Copy link

Brewj commented Mar 14, 2016

Hi there, I'm trying to inhibit the button on my Piface while the script is running, I can't seem to make it work any one any ideas?https://github.com/Brewj/Event-Trigger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants