Skip to content

argandas/goduino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goduino

Go's package for Arduino

Goduino uses Firmata protocol for Arduino

GoDoc

Prerequisites

  1. Download and install the Arduio IDE
  2. Plug in your Arduino via USB
  3. Open the Arduino IDE and open: File > Examples > StandardFirmata
  4. Select Arduino´s board: Tools > Board
  5. Select Arduino´s serial port: Tools > Serial Port
  6. Click the Upload button

Installation

	go get github.com/argandas/goduino

Usage

package main

import (
	"fmt"
	"github.com/argandas/goduino"
	"time"
)

func main() {
	arduino := goduino.New("myArduino", "COM1")
	err := arduino.Connect()
	if err != nil {
		fmt.Println(err)
		return
	}
	defer arduino.Disconnect()
	
	arduino.PinMode(13, goduino.Output)
	for {
		arduino.DigitalWrite(13, 1)
		arduino.Delay(time.Millisecond * 500)
		arduino.DigitalWrite(13, 0)
		arduino.Delay(time.Millisecond * 500)
	}
}

Note: For this example the selected serial port is COM1, be sure your Arduino is connected on this serial port.

Stable versions

This package has been tested on Go v1.4.2 & Firmata v2.4

About

Golang firmata package for Arduino (Work in progress)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages