Beispiel #1
0
func Shutdown() {
	ws2811.Wait()
	ws2811.Clear()
	ws2811.Render()
	ws2811.Wait()
	ws2811.Fini()
}
Beispiel #2
0
func Roll() {
	for i := (screenWidth + motifWidth) / 2; i > 0; i-- {
		ws2811.SetBitmap(Bitmap[0][i*16 : i*16+1024])
		ws2811.Render()
		ws2811.Wait()
		time.Sleep(50 * time.Millisecond)

		ws2811.SetBitmap(Bitmap[1][i*16-8 : i*16-8+1024])
		ws2811.Render()
		ws2811.Wait()
		time.Sleep(50 * time.Millisecond)
	}
	ws2811.SetBitmap(Bitmap[0][0:1024])
	ws2811.Render()
	ws2811.Wait()
}
Beispiel #3
0
func Init(brightness int) {
	if initialized {
		panic("Tower already initialized!")
	}
	initialized = true
	ws2811.Init(gpioPin, Rows*Columns, brightness)
	Queue = make(chan []ledmatrix.Color, queueSize)
	go func() { // Phantom of the Tower
		for {
			req := <-Queue
			ws2811.SetBitmap(req)
			ws2811.Render()
			ws2811.Wait()
		}
	}()
}