Skip to content

Commit

Permalink
spi: correct param used for APA102 Draw() method
Browse files Browse the repository at this point in the history
Signed-off-by: Ron Evans <ron@hybridgroup.com>
  • Loading branch information
deadprogram committed May 22, 2019
1 parent 78ec92a commit ee68549
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/spi/apa102.go
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ee68549

Please sign in to comment.