domotics-arduino 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -39,6 +39,9 @@ module Domotics::Arduino
39
39
  def port
40
40
  @slave.path
41
41
  end
42
+ def set_internal_state(pin, state)
43
+ @state_list[pin] = state
44
+ end
42
45
  def toggle_pin(pin)
43
46
  @state_list[pin] = @state_list[pin] == ArduinoBase::LOW ? ArduinoBase::HIGH : ArduinoBase::LOW
44
47
  @master.puts "0 #{pin} #{@state_list[pin]}"
@@ -0,0 +1,9 @@
1
+ module Domotics::Arduino
2
+ module DigitalSensor
3
+ include DigitalPin
4
+ def initialize(args = {})
5
+ super
6
+ @board.set_watch @pin, ArduinoBase::WATCHON
7
+ end
8
+ end
9
+ end
@@ -1,7 +1,7 @@
1
1
  module Domotics::Arduino
2
- # Normal_close sensor
2
+ # Normal close sensor
3
3
  module NCSensor
4
- include DigitalPin
4
+ include DigitalPin
5
5
  def initialize(args = {})
6
6
  super
7
7
  @board.set_input_pullup @pin
@@ -1,9 +1,14 @@
1
1
  module Domotics::Arduino
2
+ # Normal open sensor
2
3
  module NOSensor
3
4
  include DigitalPin
4
5
  def initialize(args = {})
5
6
  super
7
+ @board.set_input_pullup @pin
6
8
  @board.set_watch @pin, ArduinoBase::WATCHON
7
9
  end
10
+ def to_hls(value)
11
+ value == ArduinoBase::HIGH ? :off : :on
12
+ end
8
13
  end
9
14
  end
@@ -1,5 +1,5 @@
1
1
  module Domotics
2
2
  module Arduino
3
- VERSION = "0.3.4"
3
+ VERSION = "0.3.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: domotics-arduino
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
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: 2014-01-08 00:00:00.000000000 Z
12
+ date: 2014-01-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: serialport
@@ -76,6 +76,7 @@ files:
76
76
  - lib/domotics/arduino/arduino_base.rb
77
77
  - lib/domotics/arduino/board_emulator.rb
78
78
  - lib/domotics/arduino/digital_pin.rb
79
+ - lib/domotics/arduino/digital_pin/digital_sensor.rb
79
80
  - lib/domotics/arduino/digital_pin/nc_sensor.rb
80
81
  - lib/domotics/arduino/digital_pin/no_sensor.rb
81
82
  - lib/domotics/arduino/firmware/duino.pde