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:
commit
aa44fe602f
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user