package main import ( "image/color" "time" ) func Leds() { display.EnableBacklight(false) display.FillScreen(color.RGBA{0, 0, 0, 255}) ledColors := make([]color.RGBA, numLEDs) var i uint8 for { getInput() for l := uint8(0); l < numLEDs; l++ { ledColors[l] = getRainbowRGB(i + ((50 * l) / numLEDs)) } leds.WriteColors(ledColors) if goBack() { break } i += 2 time.Sleep(50 * time.Millisecond) } time.Sleep(50 * time.Millisecond) for l := 0; l < numLEDs; l++ { ledColors[l] = colorBlackLED } leds.WriteColors(ledColors) time.Sleep(50 * time.Millisecond) display.EnableBacklight(true) }