rufirmata 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -62,13 +62,18 @@ module Rufirmata
62
62
  @listening = true
63
63
  @listener = Thread.new do
64
64
  while @listening
65
- iterate
66
- sleep 0.001
65
+ begin
66
+ iterate
67
+ sleep 0.001
68
+ rescue Exception => e
69
+ puts e.message
70
+ puts e.backtrace.inspect
71
+ end
67
72
  end
68
73
  end
69
-
70
74
  end
71
75
 
76
+
72
77
  # Reads and handles data from the microcontroller over the serial port.
73
78
  #This method should be called in a main loop, or in an
74
79
  #:class:`Iterator` instance to keep this boards pin values up to date
@@ -131,7 +136,7 @@ module Rufirmata
131
136
  # bitmask wich we update the port.
132
137
  def handle_digital_message(port_number, lsb, msb)
133
138
  mask = (msb << 7) + lsb
134
- self.digital_ports[port_number].update(mask)
139
+ self.digital_ports[port_number].update(mask) if self.digital_ports[port_number]
135
140
  end
136
141
 
137
142
  def handle_report_version(major, minor)
@@ -1,3 +1,3 @@
1
1
  module Rufirmata
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rufirmata
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Nathan Stults
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-27 00:00:00 -08:00
18
+ date: 2010-11-28 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency