picommon

package
v0.29.1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package picommon contains shared information for supported and non-supported pi boards.

Index

Constants

This section is empty.

Variables

View Source
var Model = resource.DefaultModelFamily.WithModel("pi")

Model is the name used refer to any implementation of a pi based component.

View Source
var PiGPIOErrorMap = map[int]string{}/* 150 elements not displayed */

PiGPIOErrorMap maps the error codes to the human readable error names. This can be found at the pigpio C interface.

Functions

func ConvertErrorCodeToMessage added in v0.2.20

func ConvertErrorCodeToMessage(errorCode int, message string) error

ConvertErrorCodeToMessage converts error code to a human-readable string.

Types

type ServoConfig

type ServoConfig struct {
	Pin         string   `json:"pin"`
	Min         int      `json:"min,omitempty"`
	Max         int      `json:"max,omitempty"` // specifies a user inputted position limitation
	StartPos    *float64 `json:"starting_position_degs,omitempty"`
	HoldPos     *bool    `json:"hold_position,omitempty"` // defaults True. False holds for 500 ms then disables servo
	BoardName   string   `json:"board"`
	MaxRotation int      `json:"max_rotation_deg,omitempty"` // specifies a hardware position limitation. Defaults to 180
}

ServoConfig is the config for a pi servo.

func (*ServoConfig) Validate

func (config *ServoConfig) Validate(path string) ([]string, error)

Validate ensures all parts of the config are valid.

Jump to

Keyboard shortcuts

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