Socket
Socket
Sign inDemoInstall

github.com/ev3go/ev3dev

Package Overview
Dependencies
5
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/ev3go/ev3dev

Package ev3dev provides low level access to the ev3dev control and sensor drivers. See documentation at http://www.ev3dev.org/docs/drivers/. The API provided in the ev3dev package allows fluent chaining of action calls. Methods for each of the device handle types are split into three classes: action, result and constant. Action method calls return the receiver and result method calls return an error value generally with another result. Action methods result in a change of state in the robot while result methods return the requested attribute state of the robot. Constant methods return values that are constant for the device or sensor mode. To allow fluent call chains, errors are sticky for action methods and are cleared and returned by result methods. In a chain of calls the first error that is caused by an action method prevents execution of all subsequent action method calls, and is returned by the first result method called on the device handle, clearing the error state. Any attribute value returned by a call chain returning a non-nil error is invalid. To avoid confusion caused by multiple writes to the same underlying device by different handles, only one handle is allowed per physical device. In most cases, errors returned by functions in the ev3dev package implement the Causer error interface and will be able to print a stack trace if printed with the "+v" fmt verb.


Version published

Readme

Source

Gopherbrick

ev3dev is an idiomatic Go interface to an ev3dev device

Build Status Coverage Status GoDoc

The goal is to implement a simple Go style ev3dev API and helpers for common tasks.

github.com/ev3go/ev3dev depends on ev3dev stretch and has been tested on kernel 4.14.61-ev3dev-2.2.2-ev3. For jessie support see the ev3dev-jessie branch.

For device-specific functions see EV3 and BrickPi.

Currently supported:

Low level API

  • Automatic identification of attached devices
  • Buttons /dev/input/by-path/platform-gpio_keys-event
  • Power supply /sys/class/power_supply
  • LED /sys/class/leds
  • LCD /dev/fb0
  • Lego Port /sys/class/lego-port
  • Sensor /sys/class/lego-sensor
  • DC motor /sys/class/dc-motor
  • Linear actuator /sys/class/tacho-motor
  • Servo motor /sys/class/servo-motor
  • Tacho motor /sys/class/tacho-motor

Common tasks

  • Steering helper similar to EV-G steering block

Quick start compiling for a brick

Compiling for a brick can be done on the platform itself if Go is installed there, but it is generally quicker on your computer. This requires that you prefix the go build invocation with GOOS=linux GOARCH=arm GOARM=5. For example, to build the demo program you can do this:

$ GOOS=linux GOARCH=arm GOARM=5 go build github.com/ev3go/ev3dev/examples/demo

This will leave a demo executable (from the name of the package path) in your current directory. You can then copy the executable over to your brick using scp.


LEGO® is a trademark of the LEGO Group of companies which does not sponsor, authorize or endorse this software.

FAQs

Last updated on 18 Feb 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc