Skip to content

Commit

Permalink
add :colors to state, fix init_colors
Browse files Browse the repository at this point in the history
Also switch back to 500ms for feedback... 850 feels way too long on the real keypad
  • Loading branch information
Jesse Van Volkinburg committed Jul 16, 2020
1 parent 0610e74 commit fd01222
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/rgb_matrix/animation/simon.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defmodule RGBMatrix.Animation.Simon do

defmodule State do
@moduledoc false
defstruct [:leds, :simon_sequence, :state]
defstruct [:leds, :simon_sequence, :state, :colors]
end

@black Chameleon.RGB.new(0, 0, 0)
Expand Down Expand Up @@ -85,7 +85,7 @@ defmodule RGBMatrix.Animation.Simon do
rest -> %{state | state: {:expecting_input, rest}}
end

{850, colors, state}
{500, colors, state}
end

@impl true
Expand Down Expand Up @@ -133,7 +133,7 @@ defmodule RGBMatrix.Animation.Simon do
HSV.new((:rand.uniform() * 360) |> trunc(), 100, 100)
end

defp init_colors() do
defp init_colors(state) do
colors = for led <- state.leds, into: %{}, do: {led.id, random_color()}
%{state | colors: colors}
end
Expand Down

0 comments on commit fd01222

Please sign in to comment.