Skip to content

Commit e01aa7a

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

File tree

4 files changed

+12
-30
lines changed

4 files changed

+12
-30
lines changed

apps/zapdos/config/config.exs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ use Mix.Config
3030
# import_config "#{Mix.env}.exs"
3131

3232
config :extwitter, :oauth, [
33-
consumer_key: "",
34-
consumer_secret: "",
35-
access_token: "",
36-
access_token_secret: ""
33+
consumer_key: "Fw1ddOMbixLPOMWFvP2NZjEX9",
34+
consumer_secret: "2FHB8gEApM9aPwhh0EduwEWz9Yinv5lEKmIDpOVlyJTTB9uK70",
35+
access_token: "17117998-ZDEK0zkSW8mcNJISPRRJwFnMvtkJwccm8Z6EH40ak",
36+
access_token_secret: "yYB8Q8JcVfthIP5TjlL2pYJOQ7qk9UPsLpjp6IaSkpemt"
3737
]

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

0 commit comments

Comments
 (0)