Jump to content
  • 0

MCC152 python interrupt example code failed with exception "Could not enable callback function."


Zhijang

Question

Any suggestion is welcome. Thanks in advance.

Here is the error message where tried 152 interrupt python example code:

 

./digital_input_interrupt.py 
MCC 152 digital input interrupt example.
Enables interrupts on the inputs and displays their state when
they change.
   Functions / Methods demonstrated:
      mcc152.dio_reset
      mcc152.dio_config_write_port
      mcc152.dio_input_read_port
      mcc152.dio_int_status_read_port
      mcc152.info
      interrupt_callback_enable
      interrupt_callback_disable


Using address 0.

Current input values are 0xFF
Waiting for changes, enter any text to exit. 
Traceback (most recent call last):
  File "/home/pi/work/./digital_input_interrupt.py", line 122, in <module>
    main()
  File "/home/pi/work/./digital_input_interrupt.py", line 106, in main
    interrupt_callback_enable(callback, int_count)
  File "/usr/local/lib/python3.9/dist-packages/daqhats/hats.py", line 320, in interrupt_callback_enable
    raise Exception("Could not enable callback function.")
Exception: Could not enable callback function.
 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hello,

I've duplicated the error you reported, and it appears that the C and the Python digital input interrupt examples are not working. Unfortunately, at this time, I do not have a fix. I will update this post when I have more information.

Best regards,

John

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...