Documentation ¶
Overview ¶
package gopigo implements APIs to control a GoPiGo robot. This package has been tested using Raspberry PI 3. If you have any trouble using it with older version of PIs, report it in Github issues.
Index ¶
- type GoPiGo
- func (p *GoPiGo) BatteryVoltage() (volt float32, err error)
- func (p *GoPiGo) Bwd(distance int) error
- func (p *GoPiGo) DecreaseSpeed() error
- func (p *GoPiGo) DirectMotor1(direction, speed byte) error
- func (p *GoPiGo) DirectMotor2(direction, speed byte) error
- func (p *GoPiGo) DisableEncoders() error
- func (p *GoPiGo) EnableEncoders() error
- func (p *GoPiGo) Fwd(distance int) error
- func (p *GoPiGo) IncreaseSpeed() error
- func (p *GoPiGo) Left() error
- func (p *GoPiGo) LeftRotate() error
- func (p *GoPiGo) Right() error
- func (p *GoPiGo) RightRotate() error
- func (p *GoPiGo) Stop() error
- func (p *GoPiGo) TurnLeft(degrees float64) error
- func (p *GoPiGo) TurnRight(degrees float64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoPiGo ¶
type GoPiGo struct {
// contains filtered or unexported fields
}
GoPiGo represents a GoPiGo device.
func (*GoPiGo) BatteryVoltage ¶
BatteryVoltage returns the Battery Voltage reading.
func (*GoPiGo) Bwd ¶
Bwd moves the GoPiGo backwards. It takes distance in cms as input. If distance is 0, it moves backward without stopping.
func (*GoPiGo) DecreaseSpeed ¶
DecreaseSpeed slows down GoPiGo by speed of 10.
func (*GoPiGo) DirectMotor1 ¶
DirectMotor1 sets the direction and speed of motor1.
func (*GoPiGo) DirectMotor2 ¶
DirectMotor2 sets the direction and speed of motor2.
func (*GoPiGo) DisableEncoders ¶
DisableEncoders disables encoders.
func (*GoPiGo) EnableEncoders ¶
EnableEncoders enables the encoders (enabled by default).
func (*GoPiGo) Fwd ¶
Fwd moves the GoPiGo forward. It takes distance in cms as input. If specified 0, it moves forward without stopping.
func (*GoPiGo) IncreaseSpeed ¶
IncreaseSpeed bumps up the motor's speed by 10.
func (*GoPiGo) LeftRotate ¶
LeftRotate turns GoPiGo left more aggresively by rotating both the wheels in reverse direction.
func (*GoPiGo) RightRotate ¶
RightRotate turns GoPiGo to the right aggresively.