Categorygithub.com/robotic-framework/goduino
modulepackage
0.0.0-20201123075605-95c2dcd3ed16
Repository: https://github.com/robotic-framework/goduino.git
Documentation: pkg.go.dev

# README

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/robotic-framework/goduino

Usage

package main

import (
	"fmt"
	"github.com/robotic-framework/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

# Packages

No description provided by the author

# Functions

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

# Constants

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

# Structs

Arduino Firmata client for golang.

# Type aliases

No description provided by the author