gobot.io/x/gobot@v1.16.0/platforms/digispark/doc.go (about)

     1  /*
     2  Package digispark provides the Gobot adaptor for the Digispark ATTiny-based USB development board.
     3  
     4  Installing:
     5  
     6  This package requires installing `libusb`.
     7  Then you can install the package with:
     8  
     9  	go get -u -d gobot.io/x/gobot/platforms/digispark
    10  
    11  Example:
    12  
    13  	package main
    14  
    15  	import (
    16  		"time"
    17  
    18  		"gobot.io/x/gobot"
    19  		"gobot.io/x/gobot/drivers/gpio"
    20  		"gobot.io/x/gobot/platforms/digispark"
    21  	)
    22  
    23  	func main() {
    24  		digisparkAdaptor := digispark.NewAdaptor()
    25  		led := gpio.NewLedDriver(digisparkAdaptor, "0")
    26  
    27  		work := func() {
    28  			gobot.Every(1*time.Second, func() {
    29  				led.Toggle()
    30  			})
    31  		}
    32  
    33  		robot := gobot.NewRobot("blinkBot",
    34  			[]gobot.Connection{digisparkAdaptor},
    35  			[]gobot.Device{led},
    36  			work,
    37  		)
    38  
    39  		robot.Start()
    40  	}
    41  
    42  For further information refer to digispark README:
    43  https://github.com/hybridgroup/gobot/blob/master/platforms/digispark/README.md
    44  */
    45  package digispark // import "gobot.io/x/gobot/platforms/digispark"