Skip to content

Commit 966b956

Browse files
author
Chris Rees
committed
Push color to Neopixel
1 parent cbd49db commit 966b956

File tree

4 files changed

+8
-29
lines changed

4 files changed

+8
-29
lines changed

apps/zapdos/lib/zapdos.ex

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,14 @@ defmodule Zapdos do
88
def get_tweets(query) do
99
ExTwitter.stream_filter(track: query)
1010
|> Stream.map(fn(tweet) -> tweet.text end)
11-
|> Stream.map(fn(text) -> ColorParsing.get_color(text) |> ColorParsing.hex_to_number |> IO.puts end)
11+
|> Stream.map(&(update_color(&1)))
1212
|> Enum.to_list
1313
end
1414

15+
defp update_color(text) do
16+
ColorParsing.get_color(text)
17+
|> ColorParsing.parse_rgb_hex
18+
|> Lightning.Control.change_color(150)
19+
end
20+
1521
end

apps/zapdos/lib/zapdos/pluck.ex

Lines changed: 0 additions & 25 deletions
This file was deleted.

apps/zapdos/mix.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ defmodule Zapdos.Mixfile do
3535
defp deps do
3636
[
3737
{:extwitter, "~> 0.8"},
38+
{:lightning, in_umbrella: true}
3839
]
3940
end
4041
end

apps/zeus/lib/zeus.ex

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ defmodule Zeus do
1818
# for other strategies and supported options
1919
opts = [strategy: :one_for_one, name: Zeus.Supervisor]
2020
Supervisor.start_link(children, opts)
21-
22-
:timer.apply_interval(:timer.seconds(15), Zapdos, :get_tweet("#cmm_storm", 1))
23-
|> IO.puts
2421
end
2522

2623
# Tell Phoenix to update the endpoint configuration

0 commit comments

Comments
 (0)