// check if button is pressed func buttonHandler(p gpio.Pin) { for { if p.Get() { ctrlChan <- true } time.Sleep(150 * time.Millisecond) } }