lorraine 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/lib/lorraine/command.rb +22 -0
- data/lib/lorraine/version.rb +1 -1
- metadata +1 -1
data/.gitignore
CHANGED
data/lib/lorraine/command.rb
CHANGED
@@ -39,6 +39,28 @@ module Lorraine
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
+
map "i" => :interactive
|
43
|
+
desc "interactive", "Interact directly with the connection"
|
44
|
+
method_option :remote, type: :boolean, aliases: "-r", desc: "Interact over the network.", default: false
|
45
|
+
def interactive
|
46
|
+
say "Opening a connection to the LED monstrosity...", :yellow
|
47
|
+
# c = Lorraine::Connection.new
|
48
|
+
# sleep 5
|
49
|
+
say "... opened.", :green
|
50
|
+
while true
|
51
|
+
response = ask(">> ")
|
52
|
+
if response == "exit"
|
53
|
+
break
|
54
|
+
else
|
55
|
+
pixel, r, g, b = response.split(" ")
|
56
|
+
puts response
|
57
|
+
# m = Lorraine::Message.new :set_pixel, pixel, (r * 4095).to_i, (g * 4095).to_i, (b * 4095).to_i
|
58
|
+
# c.write_message(m)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
|
42
64
|
desc "debug", "Misc. debuggins"
|
43
65
|
def debug
|
44
66
|
c = Lorraine::Message.new :set_pixel, 2, 0, 0, 4095
|
data/lib/lorraine/version.rb
CHANGED