pibot

package
v0.0.0-...-35a33d0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "0.1-pre-alpha"

Version is the global version of the software

Functions

func End

func End()

End shuts down any open channels

func Forward

func Forward()

Forward calls reverse on both motors for straight forward movement

func Reverse

func Reverse()

Reverse calls reverse on both motors for straight backwards movement

func Start

func Start()

Start runs the main application

func StartBot

func StartBot(mode string)

StartBot runs the pibot in the diseried mode. This includes setting up the gpio pins.

func Stop

func Stop()

Stop sets all pins to low to stop the motors.

Types

type Motor

type Motor struct {
	Name string
	Pins [2]embd.DigitalPin
}

Motor represents the motor for controller wheels on the pibot

func NewMotor

func NewMotor(name string, motorSetting settings.MotorSetting) *Motor

NewMotor builds a motor struct and sets up the GPIO for control.

func (*Motor) Forward

func (m *Motor) Forward()

Forward sets the GPIO to high/low for forward rotation

func (*Motor) Reverse

func (m *Motor) Reverse()

Reverse sets the GPIO to low/high for reverse rotation

func (*Motor) Stop

func (m *Motor) Stop()

Stop sets the GPIO to low/low to stop rotaion

type ProximitySensor

type ProximitySensor struct {
	Name    string
	Pin     embd.DigitalPin
	Trigger chan bool
}

ProximitySensor represents one IR sensor for navigation

func NewProximitySensor

func NewProximitySensor(name string, pin int) *ProximitySensor

NewProximitySensor creates a proximity sensor for monitoring for objects

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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