1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-04-27 13:48:56 +08:00

Merge pull request #618 from conejoninja/issue617

Simplify code as suggested in #617
This commit is contained in:
Ron Evans 2018-09-16 09:11:20 +02:00 committed by GitHub
commit aa44fe602f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,7 +62,7 @@ func (a *MAX7219Driver) Start() (err error) {
a.All(MAX7219Shutdown, 0x01) a.All(MAX7219Shutdown, 0x01)
a.All(MAX7219DisplayTest, 0x00) a.All(MAX7219DisplayTest, 0x00)
a.ClearAll() a.ClearAll()
a.All(MAX7219Intensity, 0x0f&0x0f) a.All(MAX7219Intensity, 0x0f)
return return
} }
@ -86,7 +86,7 @@ func (a *MAX7219Driver) SetIntensity(level byte) {
if level > 15 { if level > 15 {
level = 15 level = 15
} }
a.All(MAX7219Intensity, level&level) a.All(MAX7219Intensity, level)
} }
// ClearAll turns off all LEDs of all modules // ClearAll turns off all LEDs of all modules