Documentation ¶
Index ¶
- Constants
- type Goduino
- func (ino *Goduino) AnalogRead(pin int) (value int, err error)
- func (ino *Goduino) Connect() error
- func (ino *Goduino) Delay(duration time.Duration)
- 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) Name() string
- func (ino *Goduino) PinMode(pin, mode int) error
- func (ino *Goduino) Port() string
- 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) Delay ¶
Close the serial connection to properly clean up after ourselves Usage: defer client.Close()
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