aboutsummaryrefslogtreecommitdiff
path: root/cmd/poll/main.go
blob: 9cbf5754d2902b5a67ace1b83533aeab290258be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package main

import (
	"fmt"
	"log"

	"dim13.org/redbutton"
)

func main() {
	dev, err := redbutton.Open()
	if err != nil {
		log.Fatal(err)
	}
	defer dev.Close()

	for ev := range redbutton.Poll(dev, redbutton.PollInterval) {
		fmt.Println(ev)
	}
}