Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Allow the registering of change events #31

Open
TylerLeonhardt opened this issue Apr 16, 2018 · 6 comments
Open

Allow the registering of change events #31

TylerLeonhardt opened this issue Apr 16, 2018 · 6 comments

Comments

@TylerLeonhardt
Copy link
Member

It would look something like this:

Register-GpioPinChangeEvent -Type LowToHigh -ScriptBlock {
    Write-Host "do the thing"
}

# and

Register-GpioPinChangeEvent -Type HighToLow -ScriptPath foo.ps1

Under the hood it could use Register-ObjectEvent to allow the script execution to be in the same runspace.

Unosquare docs here:
https://github.com/unosquare/raspberryio#interrupts-and-callbacks

@jnury
Copy link
Contributor

jnury commented Apr 18, 2018

Really useful to handle I2C devices that use interrupts pins !

@TylerLeonhardt TylerLeonhardt changed the title Allow the registering of change events for GPIO pins Allow the registering of change events Apr 18, 2018
@TylerLeonhardt
Copy link
Member Author

Changed the title so it doesn't only apply to GPIO :)

@matswi
Copy link

matswi commented Jun 16, 2020

@TylerLeonhardt Would this make it possible to detect button being pressed?

@TylerLeonhardt
Copy link
Member Author

That's the idea, yes

@matswi
Copy link

matswi commented Jun 16, 2020

That's the idea, yes

That would be really nice! :) I'm afraid I don't have the skills to make it but would be happy to help with testing it.
Is there any plan on moving forward with it?

@DanielSSilva
Copy link
Contributor

@matswi we are currently migrating to .NET IoT library.
The closest that we will have so far (I think) "out of the box" will be the possibility to register an event for changes
https://github.com/dotnet/iot/blob/master/src/System.Device.Gpio/System/Device/Gpio/GpioController.cs#L281-L296
There's no ETA I'm afraid

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

No branches or pull requests

4 participants