spi: correct param used for APA102 Draw() method

Signed-off-by: Ron Evans <ron@hybridgroup.com>
This commit is contained in:
Ron Evans 2019-05-21 15:31:32 +02:00
parent 78ec92af7a
commit ee68549f94
1 changed files with 3 additions and 2 deletions

View File

@ -1,9 +1,10 @@
package spi
import (
"gobot.io/x/gobot"
"image/color"
"math"
"gobot.io/x/gobot"
)
// APA102Driver is a driver for the APA102 programmable RGB LEDs
@ -93,7 +94,7 @@ func (d *APA102Driver) Draw() error {
for i, c := range d.vals {
j := (i + 1) * 4
tx[j] = 0xe0 + byte(math.Min(c.A, 31))
tx[j] = 0xe0 + byte(math.Min(float64(c.A), 31))
tx[j+1] = byte(c.B)
tx[j+2] = byte(c.G)
tx[j+3] = byte(c.R)