arduino

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinPwmThrottle = 972.0
	MaxPwmThrottle = 1954.0
)

Variables

View Source
var (
	DefaultPwmThrottle = PWMConfig{
		Min:    MinPwmThrottle,
		Max:    MaxPwmThrottle,
		Middle: MinPwmThrottle + (MaxPwmThrottle-MinPwmThrottle)/2,
	}
)

Functions

This section is empty.

Types

type Option added in v0.9.0

type Option func(p *Part)

func WithMaxThrottleCtrl added in v0.11.0

func WithMaxThrottleCtrl(throttleCtrl *PWMConfig) Option

func WithSteeringConfig added in v0.9.0

func WithSteeringConfig(steeringConfig *PWMConfig) Option

func WithThrottleConfig added in v0.9.0

func WithThrottleConfig(throttleConfig *PWMConfig) Option

func WithThrottleFeedbackConfig added in v0.9.0

func WithThrottleFeedbackConfig(filename string) Option

type PWMConfig added in v0.9.0

type PWMConfig struct {
	Min    int
	Max    int
	Middle int
}

func NewAsymetricPWMConfig added in v0.9.0

func NewAsymetricPWMConfig(min, max, middle int) *PWMConfig

func NewPWMConfig added in v0.9.0

func NewPWMConfig(min, max int) *PWMConfig

type Part

type Part struct {
	// contains filtered or unexported fields
}

func NewPart

func NewPart(client mqtt.Client, name string, baud int, throttleTopic, steeringTopic, driveModeTopic,
	switchRecordTopic, throttleFeedbackTopic, maxThrottleCtrlTopic string, pubFrequency float64, options ...Option) *Part

func (*Part) DriveMode added in v0.9.0

func (a *Part) DriveMode() events.DriveMode

func (*Part) MaxThrottleCtrl added in v0.11.0

func (a *Part) MaxThrottleCtrl() float32

func (*Part) Start

func (a *Part) Start() error

func (*Part) Steering added in v0.9.0

func (a *Part) Steering() float32

func (*Part) Stop

func (a *Part) Stop()

func (*Part) SwitchRecord added in v0.9.0

func (a *Part) SwitchRecord() bool

func (*Part) Throttle added in v0.9.0

func (a *Part) Throttle() float32

func (*Part) ThrottleFeedback added in v0.9.0

func (a *Part) ThrottleFeedback() float32

Jump to

Keyboard shortcuts

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