Skip to content

Commit

Permalink
added Leds#each
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotize committed Mar 2, 2019
1 parent a5bcd08 commit da0517c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/fluxcr/leds.cr
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module Fluxcr

@leds.each do |led|
spawn do
channel.send({led: led, status: led.get_status})
channel.send(led: led, status: led.get_status)
end
end

Expand All @@ -26,6 +26,12 @@ module Fluxcr
end
end

def each
@leds.each do |led|
yield led
end
end

def turn_all_on
@leds.each do |led|
led.set_on
Expand Down

0 comments on commit da0517c

Please sign in to comment.