Documentation
¶
Overview ¶
Package gopherbot is the TinyGo code for the Gopherbot programmable robotic plushie.
Index ¶
- Constants
- func EnsureADCInit()
- func EnsureI2CInit()
- func Rescale(input, fromMin, fromMax, toMin, toMax int32) int32
- type AccelerometerDevice
- type AntennaDevice
- type BackpackDevice
- func (b *BackpackDevice) Alternate(color1, color2 color.RGBA)
- func (b *BackpackDevice) Blue()
- func (b *BackpackDevice) Clear()
- func (b *BackpackDevice) Green()
- func (b *BackpackDevice) Off()
- func (b *BackpackDevice) Red()
- func (b *BackpackDevice) SetColor(color color.RGBA)
- func (b *BackpackDevice) Show()
- func (b *BackpackDevice) Xmas()
- type ButtonDevice
- type LEDDevice
- type LightMeterDevice
- type SliderDevice
- type SpeakerDevice
- type ThermometerDevice
- type VisorDevice
- func (v *VisorDevice) Alternate(color1, color2 color.RGBA)
- func (v *VisorDevice) Blue()
- func (v *VisorDevice) Clear()
- func (v *VisorDevice) Cylon()
- func (v *VisorDevice) Green()
- func (v *VisorDevice) Off()
- func (v *VisorDevice) Red()
- func (v *VisorDevice) SetColor(color color.RGBA)
- func (v *VisorDevice) Show()
- func (v *VisorDevice) Xmas()
Constants ¶
const ( // BackpackLEDCount is how many WS2812 LEDs are on the backpack, aka // the Circuit Playground Express. BackpackLEDCount = 10 // VisorLEDCount is how many WS2812 LEDs are on the helmet visor. VisorLEDCount = 12 )
Variables ¶
This section is empty.
Functions ¶
func EnsureADCInit ¶
func EnsureADCInit()
EnsureADCInit makes sure that the Gopherbot ADC has been initialized, but is only initialized once.
func EnsureI2CInit ¶
func EnsureI2CInit()
EnsureI2CInit makes sure that the Gopherbot I2C has been initialized, but is only initialized once.
Types ¶
type AccelerometerDevice ¶
AccelerometerDevice controls the Gopherbot built-in LIS3DH.
func Accelerometer ¶
func Accelerometer() *AccelerometerDevice
Accelerometer returns the AccelerometerDevice.
type AntennaDevice ¶
type AntennaDevice struct {
LEDDevice
}
AntennaDevice controls the LED of the Gopherbot Helmet's antenna.
func Antenna ¶
func Antenna() *AntennaDevice
Antenna returns a the Antenna to control the Gopherbot Antenna LED.
type BackpackDevice ¶
type BackpackDevice struct { ws2812.Device LED []color.RGBA // contains filtered or unexported fields }
BackpackDevice controls the Gopherbot Backpack LED.
func Backpack ¶
func Backpack() *BackpackDevice
Backpack returns a BackpackDevice to control Gopherbot Backpack.
func (*BackpackDevice) Alternate ¶
func (b *BackpackDevice) Alternate(color1, color2 color.RGBA)
Alternate the 2 colors.
func (*BackpackDevice) Blue ¶
func (b *BackpackDevice) Blue()
Blue turns all of the Backpack LEDs b;ue.
func (*BackpackDevice) Green ¶
func (b *BackpackDevice) Green()
Green turns all of the Backpack LEDs green.
func (*BackpackDevice) SetColor ¶
func (b *BackpackDevice) SetColor(color color.RGBA)
SetColor sets the Backpack LEDs to a single color.
func (*BackpackDevice) Show ¶
func (b *BackpackDevice) Show()
Show sets the Backpack to display the current LED array state.
type ButtonDevice ¶
ButtonDevice is a button.
func (*ButtonDevice) Pushed ¶
func (b *ButtonDevice) Pushed() bool
Pushed checks to see if the button is being pushed.
type LEDDevice ¶
LEDDevice controls any of the standard LEDs on Gopherbot.
type LightMeterDevice ¶
LightMeterDevice controls the Gopherbot built-in photoresistor.
type SliderDevice ¶
SliderDevice is the slider switch.
func (*SliderDevice) IsOn ¶
func (s *SliderDevice) IsOn() bool
IsOn checks to see if the slider is in on position.
type SpeakerDevice ¶
SpeakerDevice is the Gopherbot speaker.
func (*SpeakerDevice) Bleep ¶
func (s *SpeakerDevice) Bleep()
Bleep makes a bleep sound using the speaker.
func (*SpeakerDevice) Blip ¶
func (s *SpeakerDevice) Blip()
Blip makes a blip sound using the speaker.
func (*SpeakerDevice) Bloop ¶
func (s *SpeakerDevice) Bloop()
Bloop makes a bloop sound using the speaker.
type ThermometerDevice ¶
type ThermometerDevice struct {
thermistor.Device
}
ThermometerDevice controls the Gopherbot built-in thermistor.
type VisorDevice ¶
type VisorDevice struct { ws2812.Device LED []color.RGBA // contains filtered or unexported fields }
VisorDevice controls the Gopherbot Visor Neopixel LED.
func (*VisorDevice) Alternate ¶
func (v *VisorDevice) Alternate(color1, color2 color.RGBA)
Alternate the 2 colors.
func (*VisorDevice) SetColor ¶
func (v *VisorDevice) SetColor(color color.RGBA)
SetColor sets the Visor LEDs to a single color.
func (*VisorDevice) Show ¶
func (v *VisorDevice) Show()
Show sets the visor to display the current LED array state.