littlewire 0.9.5 → 0.9.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/digiread.rb +7 -0
- data/lib/analog.rb +1 -1
- data/lib/digital.rb +1 -1
- data/lib/littlewire.rb +3 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 672e15656164047ad4895db0099cea33b13bb861
|
4
|
+
data.tar.gz: 79ecc40349391da72aa766b11c7f2ec667a565ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7959de400ac104e7671353af22aa9207d1d74a71ecee220ec2629bc87b08956a745eb5d8d29a01e1501fb906fb69440e8e53726854bf5ff156d28355973bc70b
|
7
|
+
data.tar.gz: f1e7674e363807d7d8e1af74d0504a9f0d5740c31ff04d5be17ec73814a5e2a0d65b4a9cb5886ecf279f1fda5a29eba74057300965086391d9897ecf1dac31bf
|
data/lib/analog.rb
CHANGED
data/lib/digital.rb
CHANGED
@@ -65,7 +65,7 @@ module LittleWire::Digital
|
|
65
65
|
port = control_transfer(function: :read, dataIn: 1).unpack('c').first
|
66
66
|
mapped = pins.map do |pin|
|
67
67
|
pin = get_pin(LittleWire::DigitalPinMap, pin)
|
68
|
-
(port
|
68
|
+
((port >> pin) & 1) == 1 # discover if pin is high or low
|
69
69
|
end
|
70
70
|
|
71
71
|
if args.length == 1 and (args.first.is_a?(Symbol) or args.first.is_a?(Integer))
|
data/lib/littlewire.rb
CHANGED
@@ -31,8 +31,8 @@ class LittleWire
|
|
31
31
|
pin3: 5, d3: 5, reset: 5, ds5: 5,
|
32
32
|
pin4: 0, d4: 0, mosi: 0, pwm_a: 0, pwm_1: 0, ds0: 0 }
|
33
33
|
AnalogPinMap = { # maps common names to switch index in littlewire firmware
|
34
|
-
a1: 0, adc_1: 0, reset: 0, pin3: 0, d3: 0,
|
35
|
-
a2: 1, adc_2: 1, sck: 1, pin2: 1, d2: 1,
|
34
|
+
a1: 0, adc_1: 0, reset: 0, pin3: 0, d3: 0, ds5: 0,
|
35
|
+
a2: 1, adc_2: 1, sck: 1, pin2: 1, d2: 1, ds2: 1,
|
36
36
|
temperature: 2, temp: 2 }
|
37
37
|
HardwarePWMPinMap = { # maps common pin names to @hardware_pwm array index
|
38
38
|
pwm_b: 1, pwm_1: 1, d1: 1, pin1: 1, miso: 1,
|
@@ -164,6 +164,7 @@ class LittleWire
|
|
164
164
|
raise "You need to update your LittleWire firmware to version 1.2 to use One Wire" unless version_hex >= 0x12
|
165
165
|
@ws2811 ||= Array.new
|
166
166
|
pin = get_pin(LittleWire::DigitalPinMap, pin || 0)
|
167
|
+
raise "Unknown pin #{pin.inspect}" unless pin.is_a? Integer
|
167
168
|
@ws2811[pin] ||= WS2811.new(self, pin)
|
168
169
|
return @ws2811[pin]
|
169
170
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: littlewire
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bluebie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: libusb
|
@@ -61,6 +61,7 @@ files:
|
|
61
61
|
- readme.md
|
62
62
|
- license.txt
|
63
63
|
- examples/blinky.rb
|
64
|
+
- examples/digiread.rb
|
64
65
|
- examples/fadey.rb
|
65
66
|
- examples/led pixel.rb
|
66
67
|
homepage: http://creativepony.com/littlewire/
|
@@ -84,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
85
|
version: '0'
|
85
86
|
requirements: []
|
86
87
|
rubyforge_project:
|
87
|
-
rubygems_version: 2.0.
|
88
|
+
rubygems_version: 2.0.3
|
88
89
|
signing_key:
|
89
90
|
specification_version: 4
|
90
91
|
summary: A tiny library for littlewire.cc usb devices
|