File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,11 @@ func (b *BackpackDevice) Show() {
31
31
b .WriteColors (b .LED )
32
32
}
33
33
34
+ // Off turns off all the LEDs.
35
+ func (b * BackpackDevice ) Off () {
36
+ b .Clear ()
37
+ }
38
+
34
39
// Clear clears the Backpack LEDs.
35
40
func (b * BackpackDevice ) Clear () {
36
41
b .SetColor (color.RGBA {R : 0x00 , G : 0x00 , B : 0x00 })
Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ func main() {
21
21
time .Sleep (500 * time .Millisecond )
22
22
23
23
antenna .Off ()
24
- visor .Clear ()
25
- backpack .Clear ()
24
+ visor .Off ()
25
+ backpack .Off ()
26
26
time .Sleep (500 * time .Millisecond )
27
27
}
28
28
}
Original file line number Diff line number Diff line change @@ -33,6 +33,11 @@ func (v *VisorDevice) Show() {
33
33
v .WriteColors (v .LED )
34
34
}
35
35
36
+ // Off turns off all the LEDs.
37
+ func (v * VisorDevice ) Off () {
38
+ v .Clear ()
39
+ }
40
+
36
41
// Clear clears the visor.
37
42
func (v * VisorDevice ) Clear () {
38
43
for i := range v .LED {
You can’t perform that action at this time.
0 commit comments