Skip to content

Demo from readme crashes when run (Windows) #8

@csm10495

Description

@csm10495

Hey folks,

I recently got a blinkstick and wanted to see how hard it would be to mess with it via golang. I found this library. I took the code from the readme and tried to give it a run and hit a quick crash (during build):

main.go:

package main

import (
	"fmt"
	"image/color"
	"time"

	"github.com/boombuler/led"
)

var RED color.RGBA = color.RGBA{0xFF, 0x00, 0x00, 0xFF}

func main() {
	for devInfo := range led.Devices() {
		dev, err := devInfo.Open()
		if err != nil {
			fmt.Println(err)
			continue
		}
		defer dev.Close()
		dev.SetColor(RED)

		time.Sleep(2 * time.Second) // Wait 2 seconds because the device will turn off once it is closed!
	}
}
c:\Users\csm10495\Desktop\blinkstick-status>go mod tidy

c:\Users\csm10495\Desktop\blinkstick-status>go run .
runtime/cgo: C:\Program Files\Go\pkg\tool\windows_amd64\cgo.exe: exit status 2

c:\Users\csm10495\Desktop\blinkstick-status>go version
go version go1.24.3 windows/amd64

Were there some other steps that I needed to take to get the sample up and running?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions