Skip to content

Commit fd01222

Browse files
author
Jesse Van Volkinburg
committed
add :colors to state, fix init_colors
Also switch back to 500ms for feedback... 850 feels way too long on the real keypad
1 parent 0610e74 commit fd01222

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/rgb_matrix/animation/simon.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ defmodule RGBMatrix.Animation.Simon do
1515

1616
defmodule State do
1717
@moduledoc false
18-
defstruct [:leds, :simon_sequence, :state]
18+
defstruct [:leds, :simon_sequence, :state, :colors]
1919
end
2020

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

88-
{850, colors, state}
88+
{500, colors, state}
8989
end
9090

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

136-
defp init_colors() do
136+
defp init_colors(state) do
137137
colors = for led <- state.leds, into: %{}, do: {led.id, random_color()}
138138
%{state | colors: colors}
139139
end

0 commit comments

Comments
 (0)