Author Topic: IO-4 Bricklet 2.0 Interrupts  (Read 665 times)

stevehayles

  • Newbie
  • *
  • Posts: 13
    • View Profile
IO-4 Bricklet 2.0 Interrupts
« on: July 21, 2018, 14:57:54 »
Hi,

In the version 2.0 of the IO-4 bricklet we have lost the ability to have an interrupt from any of the inputs. 

This is viewed as an 'improved' API but it seems that simple interrupts can be very useful in a number of scenarios.  I was using the older IO-4 bricklet to interface with a low frequency flow meter and it's hard to replicate a similar system now with the new bricklet.

Will the original bricklet be discontinued at some point ?

Is there any way of adding interrupt capability to the new bricklet ?

Will the IO-16 board go the same way ?

Thanks

borg

  • Tinkerforge Staff
  • Administrator
  • Hero Member
  • *****
  • Posts: 3.119
    • View Profile
Re: IO-4 Bricklet 2.0 Interrupts
« Reply #1 on: July 23, 2018, 09:40:54 »
What exactly do you mean by "interrupt from any of the inputs"? There should be no functionality lost with the new API.

If you call set_all_input_value_callback_configuration with period = 1ms and value_has_to_change=True, the CALLBACK_ALL_INPUT_VALUE will be called any time that there is any change on one of the inputs.

If you only want this for one channel you can use set_input_value_callback_configuration.
Wir sind die Borg, Widerstand ist Spannung durch Stromstärke!

stevehayles

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: IO-4 Bricklet 2.0 Interrupts
« Reply #2 on: July 26, 2018, 08:36:07 »
Thanks for your reply, it makes sense now.  I was looking for a way to get an interrupt on a single edge (rising for instance) and with that in mind I misread the documentation.

I guess the simple answer for now is to simply filter out the 'falling edges' in my own code.  This will work fine for now although maybe long term being able to configure these callbacks for which edge type would be a nice addition.

Loving the Tinkerforge system by the way !