Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
github.com/raspberrypi-go-drivers/button
This drivers allows interact with a button connected to the GPIO
For full documentation, please visit
import (
"fmt"
"github.com/raspberrypi-go-drivers/button"
"github.com/stianeikeland/go-rpio/v4"
log "github.com/sirupsen/logrus"
)
func main() {
err := rpio.Open()
if err != nil {
os.Exit(1)
}
defer rpio.Close()
b1 := button.NewButton(17)
if err := b1.EnableEventDetection(); err != nil {
log.WithField("error", err).Error("impossible to enable edge detection")
}
for event := range b1.EventChan {
if event == button.Pressed {
fmt.Println("Button pressed")
} else if event == button.Released {
fmt.Println("Button released")
}
}
}
This driver has has only been tested on an Raspberry Pi Zero WH but should work well on every Raspberry Pi
MIT License
Special thanks to @stianeikeland
This driver is based on his work in stianeikeland/go-rpio
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.