Documentation
¶
Index ¶
- Constants
- type Goduino
- func (ino *Goduino) AnalogRead(pin int) (value int, err error)
- func (ino *Goduino) AnalogWrite(pin, value int) error
- func (ino *Goduino) Connect() error
- func (ino *Goduino) Delay(duration time.Duration)
- func (ino *Goduino) DhtHeatIndexC() string
- func (ino *Goduino) DhtHeatIndexF() string
- func (ino *Goduino) DhtHumidity() string
- func (ino *Goduino) DhtReport(pin int) (err error)
- func (ino *Goduino) DhtTempC() string
- func (ino *Goduino) DhtTempF() string
- func (ino *Goduino) DigitalRead(pin int) (value int, err error)
- func (ino *Goduino) DigitalWrite(pin, value int) error
- func (ino *Goduino) Disconnect() (err error)
- func (ino *Goduino) EcAverage() string
- func (ino *Goduino) EcCurrent() string
- func (ino *Goduino) EcReport(ec_pin int, temp_pin int) (err error)
- func (ino *Goduino) EcTemperature() string
- func (ino *Goduino) EcVoltage() string
- func (ino *Goduino) LeakReport(pin int) (err error)
- func (ino *Goduino) LeakStatus() string
- func (ino *Goduino) Name() string
- func (ino *Goduino) NeopixelControl(pin int, numpixels int, color int, state int) (err error)
- func (ino *Goduino) PhReport(pin int) (err error)
- func (ino *Goduino) PhValue() string
- func (ino *Goduino) PinMode(pin, mode int) error
- func (ino *Goduino) Port() string
- func (ino *Goduino) PwmWrite(pin int, level byte) (err error)
- func (ino *Goduino) ServoConfig(pin, min, max int) error
- func (ino *Goduino) ServoWrite(pin int, angle byte) (err error)
- func (ino *Goduino) UltrasoundDistance() string
- func (ino *Goduino) UltrasoundReport(pin int) (err error)
- type PinMode
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Goduino ¶
type Goduino struct {
// contains filtered or unexported fields
}
Arduino Firmata client for golang
func New ¶
Creates a new Goduino object and connects to the Arduino board over specified serial port. This function blocks till a connection is succesfullt established and pin mappings are retrieved.
func (*Goduino) AnalogRead ¶
AnalogRead retrieves value from analog pin. Returns -1 if the response from the board has timed out
func (*Goduino) AnalogWrite ¶
func (*Goduino) Delay ¶
Close the serial connection to properly clean up after ourselves Usage: defer client.Close()
func (*Goduino) DhtHeatIndexC ¶
DhtHeatIndexC returns dht heat index celsius value
func (*Goduino) DhtHeatIndexF ¶
DhtHeatIndexF returns dht heat index fahrenheit value
func (*Goduino) DhtHumidity ¶
DhtHumidity returns dht humidity value
func (*Goduino) DigitalRead ¶
DigitalRead reads the value from a specified digital pin, either HIGH or LOW.
func (*Goduino) DigitalWrite ¶
DigitalWrite write a HIGH or a LOW value to a digital pin.
If the pin has been configured as an OUTPUT with pinMode(), its voltage will be set to the corresponding value: 5V (or 3.3V on 3.3V boards) for HIGH, 0V (ground) for LOW.
func (*Goduino) Disconnect ¶
Disconnect closes the io connection to the firmata board
func (*Goduino) EcTemperature ¶
EcTemperature returns ec temperature
func (*Goduino) LeakReport ¶
LeakReport read leak status from liquid leak sensor
func (*Goduino) NeopixelControl ¶
NeopixelControl set state of neopixel.
func (*Goduino) PinMode ¶
PinMode configures the specified pin to behave either as an input or an output.
func (*Goduino) ServoConfig ¶
ServoConfig sets the pulse width in microseconds for a pin attached to a servo
func (*Goduino) ServoWrite ¶
ServoWrite writes the 0-180 degree angle to the specified pin.
func (*Goduino) UltrasoundDistance ¶
UltrasoundDistance returns the distance cm unit
func (*Goduino) UltrasoundReport ¶
UltrasoundReport read distance from Ultrasound sensor.