Documentation ¶
Index ¶
- Constants
- type BB
- func (bb *BB) ArmBasePan(angle byte) error
- func (bb *BB) ArmBaseTilt(angle byte) error
- func (bb *BB) ArmElbow(angle byte) error
- func (bb *BB) ArmGrip(angle byte) error
- func (bb *BB) ArmWristRotate(angle byte) error
- func (bb *BB) ArmWristTilt(angle byte) error
- func (bb *BB) GetAmbientLight() (uint16, error)
- func (bb *BB) GetBatteryPercentage() (byte, error)
- func (bb *BB) GetStatus() (uint16, error)
- func (bb *BB) GetTemperatureAndHumidity() (t byte, h byte, e error)
- func (bb *BB) Reset(pin byte)
- func (bb *BB) Sleep() error
- func (bb *BB) Tilt(angle byte) error
- func (bb *BB) Wake() error
- type StatusError
Constants ¶
const ( MinTilt = C.MinTilt MaxTilt = C.MaxTilt )
Min/Max allowed value for tilt (degrees)
const Address = C.I2CAddress
Address of BotBoarduino on i2c bus
const (
ModuleArm = C.ModuleArm
)
Robotic ARM controls
const (
ModuleBoard = C.ModuleBoard
)
Reading Arduino board state
const (
ModuleCommand = C.ModuleCommand
)
Sending commands/actions to Arduino
const (
ModuleEnvironmentSensor = C.ModuleEnvironmentSensor
)
Environment sensor installed on the robot
const (
ModuleLightSensor = C.ModuleLightSensor
)
Ambient light sensor installed on the robot
const (
ModuleTilt = C.ModuleTilt
)
Pan & Tilt installed on the robot, normally has LIDAR attached
const ResetPin = 4
ResetPin is a Raspberry Pi pin that is connected to the Arduino Reset pin
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BB ¶
type BB struct {
// contains filtered or unexported fields
}
BB is a control interface for BotBoarduino part of the project
func (*BB) ArmBasePan ¶
ArmBasePan commands BB to rotate robotic arm base, 0-180 degrees
func (*BB) ArmBaseTilt ¶
ArmBaseTilt commands BB to tilt robotic arm, 0-180 degrees
func (*BB) ArmWristRotate ¶
ArmWristRotate commands BB to rotate the wrist, 0-180 degrees
func (*BB) ArmWristTilt ¶
ArmWristTilt commands BB to tilt the wrist, 0-180 degrees
func (*BB) GetAmbientLight ¶
GetAmbientLight returns ambient light brightness in range 0..1023
func (*BB) GetBatteryPercentage ¶
GetBatteryPercentage returns estimated battery charge, in percent
func (*BB) GetStatus ¶
GetStatus returns the readiness status bitmask, which can be checked with Module* bit numbers Example:
if ((GetStatus() & (1 << ModuleEnvironmentSensor)) != 0) { // environment sensor is ready }
func (*BB) GetTemperatureAndHumidity ¶
GetTemperatureAndHumidity gets ambient temperature in Celsius and relative humidity in %
type StatusError ¶
type StatusError struct {
Status uint16
}
StatusError is returned when the status returned by BB is not compatible with the command
func (*StatusError) Error ¶
func (se *StatusError) Error() string