Categorygithub.com/argandas/go-firmata
modulepackage
0.0.0-20150716225313-3772cf236b7c
Repository: https://github.com/argandas/go-firmata.git
Documentation: pkg.go.dev

# README

go-firmata

A Golang wrapper for Firmata on Arduino

GoDoc

Installation

	go get github.com/kraman/go-firmata

Usage

package main

import (
	"github.com/kraman/go-firmata"
	"time"
)

var led uint8 = 13

func main() {
	arduino, err := firmata.NewClient("COM1", 57600)
	if err != nil {
		panic(err)
	}

	// arduino.Verbose = true

	myDelay := time.Millisecond * 250

	// Set led pin as output
	arduino.SetPinMode(led, firmata.Output)

	// Blink led 10 times
	for x := 0; x < 10; x++ {
		
		// Turn ON led
		arduino.DigitalWrite(led, true)
		arduino.Delay(myDelay)
		
		// Turn OFF led
		arduino.DigitalWrite(led, false)
		arduino.Delay(myDelay)

	}
	arduino.Close()
}

# Packages

No description provided by the author

# Functions

Creates a new FirmataClient object and connects to the Arduino board over specified serial port.

# Constants

No description provided by the author
ask for mapping of analog to pin numbers.
reply with mapping info.
send data for an analog pin (or PWM).
ask for supported modes and resolution of all pins.
reply with supported modes and resolution.
send data for a digital pin.
enable analog input by pin #.
enable digital input by port pair.
end a MIDI Sysex message.
analog write (PWM, Servo, etc) to any pin.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
config I2C settings such as delay times and power pins.
a reply to an I2C read request.
send an I2C read/write request.
pin modes.
max number of data bytes in non-Sysex messages.
No description provided by the author
ask for a pin's current mode and value.
reply with pin's current mode and value.
No description provided by the author
No description provided by the author
No description provided by the author
report name and version of the firmware.
report protocol version.
set the poll rate of the main loop.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
set max angle, minPulse, maxPulse, freq.
set a pin to INPUT/OUTPUT/PWM/etc.
No description provided by the author
a bitstream to/from a shift register.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
start a MIDI Sysex message.
a string message with 14-bits per char.
MIDI Reserved for non-realtime messages.
MIDI Reserved for realtime messages.
No description provided by the author
reset from MIDI.

# Structs

Arduino Firmata client for golang.
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author