hybridgroup.gobot/platforms/digispark
Thomas Kohler fc4894bd51 NEW: i2c.ReadBlockData(), BUGFIX: Read*Data() in digispark and some small other fixes 2022-10-01 17:33:02 +02:00
..
LICENSE docs: update copyright date to 2018 2018-02-14 08:24:39 +01:00
README.md digispark: update README with latest development info 2017-06-15 14:04:08 +02:00
digispark_adaptor.go digispark: remove test method that should not be in adaptor 2018-08-24 20:58:57 +02:00
digispark_adaptor_test.go digispark fix ReadByte & WriteByte, rework and add i2c tests 2022-04-17 15:02:01 +02:00
digispark_i2c.go NEW: i2c.ReadBlockData(), BUGFIX: Read*Data() in digispark and some small other fixes 2022-10-01 17:33:02 +02:00
digispark_i2c_test.go NEW: i2c.ReadBlockData(), BUGFIX: Read*Data() in digispark and some small other fixes 2022-10-01 17:33:02 +02:00
doc.go docs: correct Digispark readme link 2016-12-21 10:51:37 +01:00
littleWire.c littlewire.cc links changed to littlewire.github.io 2017-06-11 00:02:09 +03:00
littleWire.go Digispark i2c fixes, added Test for checking available addresses 2018-08-17 20:02:45 +02:00
littleWire.h littlewire.cc links changed to littlewire.github.io 2017-06-11 00:02:09 +03:00
littleWire_servo.c WIP project restructure 2014-04-29 13:20:32 -07:00
littleWire_servo.h WIP project restructure 2014-04-29 13:20:32 -07:00
littleWire_util.c WIP project restructure 2014-04-29 13:20:32 -07:00
littleWire_util.h WIP project restructure 2014-04-29 13:20:32 -07:00
opendevice.c WIP project restructure 2014-04-29 13:20:32 -07:00
opendevice.h WIP project restructure 2014-04-29 13:20:32 -07:00

README.md

Digispark

The Digispark is an Attiny85 based microcontroller development board similar to the Arduino line, only cheaper, smaller, and a bit less powerful. With a whole host of shields to extend its functionality and the ability to use the familiar Arduino IDE the Digispark is a great way to jump into electronics, or perfect for when an Arduino is too big or too much.

This package provides the Gobot adaptor for the Digispark ATTiny-based USB development board with the Little Wire protocol firmware installed.

How to Install

This package requires libusb.

OSX

To install libusb on OSX using Homebrew:

$ brew install libusb && brew install libusb-compat

Ubuntu

To install libusb on linux:

$ sudo apt-get install libusb-dev

Now you can install the package with

go get -d -u gobot.io/x/gobot/...

How to Use

package main

import (
	"time"

	"gobot.io/x/gobot"
	"gobot.io/x/gobot/drivers/gpio"
	"gobot.io/x/gobot/platforms/digispark"
)

func main() {
	digisparkAdaptor := digispark.NewAdaptor()
	led := gpio.NewLedDriver(digisparkAdaptor, "0")

	work := func() {
		gobot.Every(1*time.Second, func() {
			led.Toggle()
		})
	}

	robot := gobot.NewRobot("blinkBot",
		[]gobot.Connection{digisparkAdaptor},
		[]gobot.Device{led},
		work,
	)

	robot.Start()
}

How to Connect

If your Digispark already has the Little Wire protocol firmware installed, you can connect right away with Gobot.

Otherwise, you must first flash your Digispark with the Little Wire firmware.

The easiest way to flash your Digispark is to use Gort https://gort.io.

Download and install Gort, and then use the following commands:

Then, install the needed Digispark firmware.

gort digispark install

OSX

Important: 2012 MBP The USB ports on the 2012 MBPs (Retina and non) cause issues due to their USB3 controllers, currently the best work around is to use a cheap USB hub (non USB3).

Plug the Digispark into your computer via the USB port and run:

gort digispark upload littlewire

Ubuntu

Ubuntu requires an extra one-time step to set up the Digispark for communication with Gobot. Run the following command:

gort digispark set-udev-rules

You might need to enter your administrative password. This steps adds a udev rule to allow access to the Digispark device.

Once this is done, you can upload Little Wire to your Digispark:

gort digispark upload littlewire

Windows

We need instructions here, because it supposedly works.

Manual instructions

For manual instructions on how to install Little Wire on a Digispark check out http://digistump.com/board/index.php/topic,160.0.html

Thanks to @bluebie for these instructions! (https://github.com/Bluebie/micronucleus-t85/wiki/Ubuntu-Linux)

Now plug the Digispark into your computer via the USB port.