gpio

package
v0.0.0-...-f25091a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

This package is a wrapper for the package github.com/stianeikeland/go-rpio. To make it easier to control the raspberry pi gpio pins.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoState = errors.New("value not a state")
)

Functions

func SetState

func SetState(pinNum int, state int) error

SetState sets the state of a gpio pin. it accepts an int value 1 for High also current 0 also no current.

Types

type State

type State uint8

Set types

var (
	High State = 1 //High is the state of the gpio pin if current is on the pin
	Low  State = 0 //Low is the state of the pin if there is no current present
)

Declare the variable that are the states of the gpio pins

func GetState

func GetState(pinNum int) (State, error)

GetState returns the state of a pio pin possible return values are High=1 or Low=0 it depends of the state og the pin if the pin has current on it High is returned when no current is present Low is returned.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL