func (bl *Blinkt) SetClearOnExit(clearOnExit bool) {
	if clearOnExit {
		signalChan := make(chan os.Signal, 1)
		signal.Notify(signalChan, os.Interrupt)
		fmt.Println("Press Control + C to stop")
		go func() {
			for range signalChan {
				bl.Clear()
				bl.Show()
				gpio.Cleanup()
				os.Exit(1)
			}
		}()
	}
}
SetClearOnExit turns all pixels off on Control + C / os.Interrupt signal.
package sysfs
import (
	"fmt"
	"log"
	"os"
	"os/signal"
	"time"
	"github.com/alexellis/blinkt_go/sysfs/gpio"
)
const DAT int = 23
const CLK int = 24
const redIndex int = 0
const greenIndex int = 1
const blueIndex int = 2
const brightnessIndex int = 3
const defaultBrightnessInt int = 15
const minBrightness float64 = 0.0
const maxBrightness float64 = 1.0
func writeByte(val int) {
	for i := 0; i < 8; i++ {
		gpio.DigitalWrite(gpio.GpioToPin(DAT), val&128)
		gpio.DigitalWrite(gpio.GpioToPin(CLK), 1)
		val = val << 1
		gpio.DigitalWrite(gpio.GpioToPin(CLK), 0)
	}
}
func convertBrightnessToInt(brightness float64) int {
	if !inRangeFloat(minBrightness, brightness, maxBrightness) {
		log.Fatalf("Supplied brightness was %#v - value should be between: %#v and %#v", brightness, minBrightness, maxBrightness)
	}
	return int(brightness * 31.0)
}
func inRangeFloat(minVal float64, testVal float64, maxVal float64) bool {
	return (testVal >= minVal) && (testVal <= maxVal)
}