Skip to content

Commit

Permalink
added button example
Browse files Browse the repository at this point in the history
  • Loading branch information
Binozo committed Dec 26, 2023
1 parent 6a663b0 commit 61abf4f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions examples/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,26 @@ package examples
import (
"bytes"
"fmt"
"github.com/Binozo/EchoGoSDK/pkg/buttons"
"github.com/Binozo/EchoGoSDK/pkg/led"
"github.com/Binozo/EchoGoSDK/pkg/mic"
"time"
)

func main() {
// Init Buttons
if err := buttons.Init(); err != nil {
panic(err)
}

buttons.ListenForVolumeButtons(func() {
// Up
led.SetColorAll(0, 255, 0)
}, func() {
// Down
led.SetColorAll(255, 0, 0)
})

// Init LEDs
if err := led.Init(); err != nil {
panic(err)
Expand Down

0 comments on commit 61abf4f

Please sign in to comment.