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
Prerequisites
- Download and install the Arduio IDE
- Plug in your Arduino via USB
- Open the Arduino IDE and open:
File > Examples > StandardFirmata
- Select Arduino´s board:
Tools > Board
- Select Arduino´s serial port:
Tools > Serial Port
- 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.
# Type aliases
No description provided by the author