pi_sensor 0.1.0 → 0.1.1
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.
- data/lib/pi_sensor/sht15.rb +3 -6
- data/lib/pi_sensor/version.rb +1 -1
- metadata +1 -1
data/lib/pi_sensor/sht15.rb
CHANGED
@@ -102,12 +102,12 @@ module PiSensor
|
|
102
102
|
|
103
103
|
io.mode(@data, INPUT)
|
104
104
|
if io.read(@data) != LOW
|
105
|
-
raise SensorError, "Sensor should be LOW but isn't"
|
105
|
+
raise SensorError, "Sensor measurement confirmation error: data pin should be LOW but isn't."
|
106
106
|
end
|
107
107
|
|
108
108
|
io.write(@clock, LOW)
|
109
109
|
if io.read(@data) != HIGH
|
110
|
-
raise SensorError, "Sensor should be HIGH but isn't"
|
110
|
+
raise SensorError, "Sensor measurement confirmation error: sensor should be HIGH but isn't."
|
111
111
|
end
|
112
112
|
|
113
113
|
end
|
@@ -120,19 +120,16 @@ module PiSensor
|
|
120
120
|
io.mode(@data, INPUT)
|
121
121
|
|
122
122
|
# Wait for measurement
|
123
|
-
puts "Waiting for sensor to take measurement..."
|
124
123
|
1.upto(10) do |i|
|
125
124
|
sleep(0.1)
|
126
125
|
if io.read(@data) == LOW
|
127
126
|
break
|
128
127
|
end
|
129
128
|
end
|
130
|
-
puts "Data pin LOW, ready to read measurement."
|
131
129
|
|
132
130
|
# If pin is still high at this point, we've got a problem
|
133
131
|
if io.read(@data) == HIGH
|
134
|
-
|
135
|
-
exit 0
|
132
|
+
raise SensorError, "Sensor measurement failure: sensor not completing measurement in a timely manner."
|
136
133
|
end
|
137
134
|
|
138
135
|
# Read first 8 bits
|
data/lib/pi_sensor/version.rb
CHANGED