remote

package
v0.0.0-...-6b1210f Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRemoteControl

func NewRemoteControl(settings RemoteSettings) *remoteControl

Types

type PushButton

type PushButton interface {
	Name() string
	Index() int
	Update()
	IsPressed() bool
	IsPushed() bool
	IsPushButton() bool
}

type RemoteConfigs

type RemoteConfigs struct {
	CommandsPerSecond int `json:"commands-per-second"`
	Radio             struct {
		RxTxAddress string                  `json:"rx-tx-address"`
		SPI         hardware.SPIConnConfigs `json:"spi"`
	} `json:"radio"`
	Joysticks struct {
		RollChannel int    `json:"roll-channel"`
		RollMin     uint16 `json:"roll-min"`
		RollMid     uint16 `json:"roll-mid"`
		RollMax     uint16 `json:"roll-max"`

		PitchChannel int    `json:"pitch-channel"`
		PitchMin     uint16 `json:"pitch-min"`
		PitchMid     uint16 `json:"pitch-mid"`
		PitchMax     uint16 `json:"pitch-max"`

		YawChannel int    `json:"yaw-channel"`
		YawMin     uint16 `json:"yaw-min"`
		YawMid     uint16 `json:"yaw-mid"`
		YawMax     uint16 `json:"yaw-max"`

		ThrottleChannel int    `json:"throttle-channel"`
		ThrottleMin     uint16 `json:"throttle-min"`
		ThrottleMid     uint16 `json:"throttle-mid"`
		ThrottleMax     uint16 `json:"throttle-max"`

		I2CAddress hardware.SPIConnConfigs `json:"i2c-address"`
	} `json:"joysticks"`
	PushButtons []struct {
		Name         string `json:"name"`
		Index        int    `json:"index"`
		IsPushButton bool   `json:"is-push-button"`
		GPIO         string `json:"gpio"`
	} `json:"push-buttons-gpio"`
	DisplayUpdatePerSecond int `json:"display-update-per-second"`
}

func ReadConfigs

func ReadConfigs(configPath string) RemoteConfigs

type RemoteSettings

type RemoteSettings struct {
	Transmitter                radioTransmiter
	CommandPerSecond           int
	JoyStick                   joystick
	Roll, Pitch, Yaw, Throttle int
	PushButtons                []PushButton
	OLED                       oled
	DisplayUpdatePerSecond     int
	RollMin                    uint16
	PitchMin                   uint16
	YawMin                     uint16
	ThrottleMin                uint16
	RollMid                    uint16
	PitchMid                   uint16
	YawMid                     uint16
	ThrottleMid                uint16
	RollMax                    uint16
	PitchMax                   uint16
	YawMax                     uint16
	ThrottleMax                uint16
	RotationRange              float64
}

Jump to

Keyboard shortcuts

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