digiusb 0.0.7 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/digiterm +7 -2
- data/examples/digiblink.rb +2 -3
- metadata +2 -2
data/bin/digiterm
CHANGED
@@ -6,7 +6,7 @@ require 'io/console'
|
|
6
6
|
|
7
7
|
puts "Looking for Digispark running DigiUSB...".blue
|
8
8
|
|
9
|
-
sleep 0.
|
9
|
+
sleep 0.5 until DigiUSB.sparks.length > 0
|
10
10
|
spark = DigiUSB.sparks.last
|
11
11
|
|
12
12
|
puts "Attached to #{spark.inspect.green}".blue
|
@@ -14,7 +14,12 @@ puts "Type control + c to exit".blue
|
|
14
14
|
|
15
15
|
begin
|
16
16
|
loop do
|
17
|
-
|
17
|
+
char = spark.getc
|
18
|
+
if char != ""
|
19
|
+
print char.green
|
20
|
+
else
|
21
|
+
sleep 1.0 / 30.0
|
22
|
+
end
|
18
23
|
|
19
24
|
begin
|
20
25
|
char = IO.console.read_nonblock(1)
|
data/examples/digiblink.rb
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
# A little example program for driving the digirgb example code
|
2
|
-
require 'digiusb'
|
3
|
-
require 'digiusb/digiblink.rb'
|
2
|
+
require 'digiusb/digiblink'
|
4
3
|
|
5
|
-
light =
|
4
|
+
light = DigiBlink.sparks.last # get the spark most recently plugged in (or maybe just a random one? not sure)
|
6
5
|
raise "Couldn't find a DigiUSB device to talk to" if light.nil?
|
7
6
|
|
8
7
|
light.color = ARGV.first
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: digiusb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: libusb
|