domotics-arduino 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/domotics-arduino.gemspec +3 -3
- data/lib/domotics/arduino/digital_pin.rb +4 -5
- data/lib/domotics/arduino/digital_pin/digital_sensor.rb +2 -2
- data/lib/domotics/arduino/digital_pin/nc_sensor.rb +3 -3
- data/lib/domotics/arduino/digital_pin/no_sensor.rb +3 -3
- data/lib/domotics/arduino/pwm_pin.rb +7 -8
- data/lib/domotics/arduino/version.rb +1 -1
- metadata +16 -25
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0756fbfb26688ad7990b66b94e4858914589a224
|
4
|
+
data.tar.gz: 2db8463de7a09dfbce3c2527eeab10dfe281ce56
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b7a67a4f83f7aa18219a55a96c65f5b87fb436d4b918befa5325fffa1193c60f571c997002111b3cea16316478e70d3fb827d5a944859e724553d43bda36b53f
|
7
|
+
data.tar.gz: 46035acffd6d06ff009c5a2fd2252419c176a7b0e4857576a19b1212d1d2539d69d9b3e30b7146df0c0b5ed0af49c10c7f608b66d1750e49640bffe15fd66cc5
|
data/domotics-arduino.gemspec
CHANGED
@@ -6,11 +6,11 @@ require 'domotics/arduino/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "domotics-arduino"
|
8
8
|
spec.version = Domotics::Arduino::VERSION
|
9
|
-
spec.authors = ["
|
9
|
+
spec.authors = ["goredar"]
|
10
10
|
spec.email = ["goredar@gmail.com"]
|
11
11
|
spec.description = %q{Arduino part of Domotics}
|
12
12
|
spec.summary = %q{Hardware drivers for arduino}
|
13
|
-
spec.homepage = "https://
|
13
|
+
spec.homepage = "https://goredar.it"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
@@ -22,4 +22,4 @@ Gem::Specification.new do |spec|
|
|
22
22
|
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.3"
|
24
24
|
spec.add_development_dependency "rake"
|
25
|
-
end
|
25
|
+
end
|
@@ -2,18 +2,17 @@ module Domotics::Arduino
|
|
2
2
|
module DigitalPin
|
3
3
|
|
4
4
|
def initialize(args = {})
|
5
|
-
@board = Domotics::Device[args[:device]]
|
6
5
|
@pin = args[:pin]
|
7
|
-
@
|
6
|
+
@device.register_pin self, @pin
|
8
7
|
super
|
9
8
|
end
|
10
9
|
|
11
10
|
def state!
|
12
|
-
to_hls @
|
11
|
+
to_hls @device.get_digital(@pin)
|
13
12
|
end
|
14
13
|
|
15
14
|
def set_state(value)
|
16
|
-
@
|
15
|
+
@device.set_digital @pin, to_lls(value)
|
17
16
|
super
|
18
17
|
end
|
19
18
|
|
@@ -27,4 +26,4 @@ module Domotics::Arduino
|
|
27
26
|
value == :on ? ArduinoBase::HIGH : ArduinoBase::LOW
|
28
27
|
end
|
29
28
|
end
|
30
|
-
end
|
29
|
+
end
|
@@ -4,8 +4,8 @@ module Domotics::Arduino
|
|
4
4
|
include DigitalPin
|
5
5
|
def initialize(args = {})
|
6
6
|
super
|
7
|
-
@
|
8
|
-
@
|
7
|
+
@device.set_input_pullup @pin
|
8
|
+
@device.set_watch @pin, ArduinoBase::WATCHON
|
9
9
|
end
|
10
10
|
end
|
11
|
-
end
|
11
|
+
end
|
@@ -4,11 +4,11 @@ module Domotics::Arduino
|
|
4
4
|
include DigitalPin
|
5
5
|
def initialize(args = {})
|
6
6
|
super
|
7
|
-
@
|
8
|
-
@
|
7
|
+
@device.set_input_pullup @pin
|
8
|
+
@device.set_watch @pin, ArduinoBase::WATCHON
|
9
9
|
end
|
10
10
|
def to_hls(value)
|
11
11
|
value == ArduinoBase::HIGH ? :off : :on
|
12
12
|
end
|
13
13
|
end
|
14
|
-
end
|
14
|
+
end
|
@@ -2,27 +2,26 @@ module Domotics
|
|
2
2
|
module Arduino
|
3
3
|
module PWMPin
|
4
4
|
|
5
|
-
def initialize(
|
6
|
-
@
|
7
|
-
@pin
|
8
|
-
@board.set_pwm_frequency @pin, 1
|
5
|
+
def initialize(args = {})
|
6
|
+
@pin = args[:pin]
|
7
|
+
@device.set_pwm_frequency @pin, 1
|
9
8
|
super
|
10
9
|
end
|
11
10
|
|
12
11
|
def set_state(value = 0)
|
13
12
|
value = case value
|
14
13
|
when 0, :off
|
15
|
-
@
|
14
|
+
@device.set_low @pin
|
16
15
|
0
|
17
16
|
when 1..254
|
18
|
-
@
|
17
|
+
@device.set_pwm @pin, value
|
19
18
|
value
|
20
19
|
when 255, :on
|
21
|
-
@
|
20
|
+
@device.set_high @pin
|
22
21
|
255
|
23
22
|
end
|
24
23
|
super value
|
25
24
|
end
|
26
25
|
end
|
27
26
|
end
|
28
|
-
end
|
27
|
+
end
|
metadata
CHANGED
@@ -1,62 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: domotics-arduino
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
5
|
-
prerelease:
|
4
|
+
version: 0.3.6
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
|
-
-
|
7
|
+
- goredar
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2014-
|
11
|
+
date: 2014-03-02 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: serialport
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: bundler
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- - ~>
|
31
|
+
- - "~>"
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '1.3'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- - ~>
|
38
|
+
- - "~>"
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '1.3'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rake
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - ">="
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
description: Arduino part of Domotics
|
@@ -66,7 +59,7 @@ executables: []
|
|
66
59
|
extensions: []
|
67
60
|
extra_rdoc_files: []
|
68
61
|
files:
|
69
|
-
- .gitignore
|
62
|
+
- ".gitignore"
|
70
63
|
- Gemfile
|
71
64
|
- LICENSE.txt
|
72
65
|
- README.md
|
@@ -84,31 +77,29 @@ files:
|
|
84
77
|
- lib/domotics/arduino/pwm_pin.rb
|
85
78
|
- lib/domotics/arduino/version.rb
|
86
79
|
- test/test_arduino.rb
|
87
|
-
homepage: https://
|
80
|
+
homepage: https://goredar.it
|
88
81
|
licenses:
|
89
82
|
- MIT
|
83
|
+
metadata: {}
|
90
84
|
post_install_message:
|
91
85
|
rdoc_options: []
|
92
86
|
require_paths:
|
93
87
|
- lib
|
94
88
|
required_ruby_version: !ruby/object:Gem::Requirement
|
95
|
-
none: false
|
96
89
|
requirements:
|
97
|
-
- -
|
90
|
+
- - ">="
|
98
91
|
- !ruby/object:Gem::Version
|
99
92
|
version: '0'
|
100
93
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
-
none: false
|
102
94
|
requirements:
|
103
|
-
- -
|
95
|
+
- - ">="
|
104
96
|
- !ruby/object:Gem::Version
|
105
97
|
version: '0'
|
106
98
|
requirements: []
|
107
99
|
rubyforge_project:
|
108
|
-
rubygems_version:
|
100
|
+
rubygems_version: 2.2.2
|
109
101
|
signing_key:
|
110
|
-
specification_version:
|
102
|
+
specification_version: 4
|
111
103
|
summary: Hardware drivers for arduino
|
112
104
|
test_files:
|
113
105
|
- test/test_arduino.rb
|
114
|
-
has_rdoc:
|