raspberry_pi_iot 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/doc/Actuator.html +145 -0
- data/doc/BH1750.html +535 -0
- data/doc/BME280.html +276 -0
- data/doc/BMP280.html +276 -0
- data/doc/BMxSensor.html +559 -0
- data/doc/BinaryActuator.html +177 -0
- data/doc/BinaryEffector.html +246 -0
- data/doc/BinaryReceptor.html +387 -0
- data/doc/BinarySensor.html +168 -0
- data/doc/Bus.html +126 -0
- data/doc/Button.html +986 -0
- data/doc/DHT11.html +287 -0
- data/doc/DHT22.html +287 -0
- data/doc/DHTxxSensor.html +361 -0
- data/doc/DS18B20.html +339 -0
- data/doc/DigitalActuator.html +164 -0
- data/doc/DigitalEffector.html +636 -0
- data/doc/DigitalReceptor.html +242 -0
- data/doc/DigitalSensor.html +162 -0
- data/doc/Effector.html +257 -0
- data/doc/HCSR501.html +172 -0
- data/doc/HumitureSensor.html +453 -0
- data/doc/IoT.html +116 -0
- data/doc/LED.html +784 -0
- data/doc/MAX44009.html +830 -0
- data/doc/RaspberryPi.html +309 -0
- data/doc/Receptor.html +257 -0
- data/doc/Sensor.html +145 -0
- data/doc/TemperatureSensor.html +644 -0
- data/doc/_index.html +379 -0
- data/doc/class_list.html +51 -0
- data/doc/file_list.html +51 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +379 -0
- data/doc/method_list.html +715 -0
- data/doc/top-level-namespace.html +112 -0
- data/lib/bh1750.rb +43 -0
- data/lib/binary_effector.rb +16 -0
- data/lib/binary_receptor.rb +23 -0
- data/lib/bmx_sensor.rb +86 -0
- data/lib/bus.rb +26 -0
- data/lib/button.rb +70 -0
- data/lib/dht_sensor.rb +36 -0
- data/lib/digital_effector.rb +56 -0
- data/lib/digital_receptor.rb +20 -0
- data/lib/ds18b20.rb +24 -0
- data/lib/effector.rb +32 -0
- data/lib/hcsr501.rb +7 -0
- data/lib/humiture_sensor.rb +26 -0
- data/lib/iot.rb +4 -0
- data/lib/led.rb +58 -0
- data/lib/led_pwm.rb +6 -0
- data/lib/led_rgb.rb +100 -0
- data/lib/max44009.rb +77 -0
- data/lib/raspberry_pi.rb +41 -0
- data/lib/raspberry_pi_iot.rb +3 -0
- data/lib/receptor.rb +33 -0
- data/lib/temperature_sensor.rb +49 -0
- data/lib/thermal_sensor.rb +22 -0
- metadata +203 -0
@@ -0,0 +1,361 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: DHTxxSensor
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.16
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "DHTxxSensor";
|
19
|
+
relpath = '';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="_index.html">Index (D)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">DHTxxSensor</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: DHTxxSensor
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName"><span class='object_link'><a href="HumitureSensor.html" title="HumitureSensor (class)">HumitureSensor</a></span></span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next"><span class='object_link'><a href="Receptor.html" title="Receptor (class)">Receptor</a></span></li>
|
78
|
+
|
79
|
+
<li class="next"><span class='object_link'><a href="DigitalReceptor.html" title="DigitalReceptor (class)">DigitalReceptor</a></span></li>
|
80
|
+
|
81
|
+
<li class="next"><span class='object_link'><a href="DigitalSensor.html" title="DigitalSensor (class)">DigitalSensor</a></span></li>
|
82
|
+
|
83
|
+
<li class="next"><span class='object_link'><a href="TemperatureSensor.html" title="TemperatureSensor (class)">TemperatureSensor</a></span></li>
|
84
|
+
|
85
|
+
<li class="next"><span class='object_link'><a href="HumitureSensor.html" title="HumitureSensor (class)">HumitureSensor</a></span></li>
|
86
|
+
|
87
|
+
<li class="next">DHTxxSensor</li>
|
88
|
+
|
89
|
+
</ul>
|
90
|
+
<a href="#" class="inheritanceTree">show all</a>
|
91
|
+
|
92
|
+
</dd>
|
93
|
+
</dl>
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
<dl>
|
106
|
+
<dt>Defined in:</dt>
|
107
|
+
<dd>lib/dht_sensor.rb</dd>
|
108
|
+
</dl>
|
109
|
+
|
110
|
+
</div>
|
111
|
+
|
112
|
+
<h2>Overview</h2><div class="docstring">
|
113
|
+
<div class="discussion">
|
114
|
+
|
115
|
+
<p>DHT11/22 humidity & temperature sensor family</p>
|
116
|
+
|
117
|
+
|
118
|
+
</div>
|
119
|
+
</div>
|
120
|
+
<div class="tags">
|
121
|
+
|
122
|
+
|
123
|
+
</div><div id="subclasses">
|
124
|
+
<h2>Direct Known Subclasses</h2>
|
125
|
+
<p class="children"><span class='object_link'><a href="DHT11.html" title="DHT11 (class)">DHT11</a></span>, <span class='object_link'><a href="DHT22.html" title="DHT22 (class)">DHT22</a></span></p>
|
126
|
+
</div>
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
<h2>
|
136
|
+
Instance Method Summary
|
137
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
138
|
+
</h2>
|
139
|
+
|
140
|
+
<ul class="summary">
|
141
|
+
|
142
|
+
<li class="public ">
|
143
|
+
<span class="summary_signature">
|
144
|
+
|
145
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(pin, sensor_model) ⇒ DHTxxSensor </a>
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
</span>
|
150
|
+
|
151
|
+
|
152
|
+
<span class="note title constructor">constructor</span>
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
<span class="summary_desc"><div class='inline'>
|
162
|
+
<p>A new instance of DHTxxSensor.</p>
|
163
|
+
</div></span>
|
164
|
+
|
165
|
+
</li>
|
166
|
+
|
167
|
+
|
168
|
+
<li class="public ">
|
169
|
+
<span class="summary_signature">
|
170
|
+
|
171
|
+
<a href="#read_data-instance_method" title="#read_data (instance method)">#<strong>read_data</strong> ⇒ Object </a>
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
</span>
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
<span class="summary_desc"><div class='inline'>
|
186
|
+
<p>Read values by 'DhtSensor.read' from 'dht-sensor-ffi'.</p>
|
187
|
+
</div></span>
|
188
|
+
|
189
|
+
</li>
|
190
|
+
|
191
|
+
|
192
|
+
</ul>
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="HumitureSensor.html" title="HumitureSensor (class)">HumitureSensor</a></span></h3>
|
205
|
+
<p class="inherited"><span class='object_link'><a href="HumitureSensor.html#humidity-instance_method" title="HumitureSensor#humidity (method)">#humidity</a></span>, <span class='object_link'><a href="HumitureSensor.html#to_s-instance_method" title="HumitureSensor#to_s (method)">#to_s</a></span></p>
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="TemperatureSensor.html" title="TemperatureSensor (class)">TemperatureSensor</a></span></h3>
|
216
|
+
<p class="inherited"><span class='object_link'><a href="TemperatureSensor.html#celsius-instance_method" title="TemperatureSensor#celsius (method)">#celsius</a></span>, <span class='object_link'><a href="TemperatureSensor.html#fahrenheit-instance_method" title="TemperatureSensor#fahrenheit (method)">#fahrenheit</a></span>, <span class='object_link'><a href="TemperatureSensor.html#kelvin-instance_method" title="TemperatureSensor#kelvin (method)">#kelvin</a></span>, <span class='object_link'><a href="TemperatureSensor.html#reaumur-instance_method" title="TemperatureSensor#reaumur (method)">#reaumur</a></span>, <span class='object_link'><a href="TemperatureSensor.html#temperature-instance_method" title="TemperatureSensor#temperature (method)">#temperature</a></span>, <span class='object_link'><a href="TemperatureSensor.html#to_s-instance_method" title="TemperatureSensor#to_s (method)">#to_s</a></span></p>
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="DigitalReceptor.html" title="DigitalReceptor (class)">DigitalReceptor</a></span></h3>
|
233
|
+
<p class="inherited"><span class='object_link'><a href="DigitalReceptor.html#one_wire_file-class_method" title="DigitalReceptor.one_wire_file (method)">one_wire_file</a></span></p>
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Receptor.html" title="Receptor (class)">Receptor</a></span></h3>
|
244
|
+
<p class="inherited"><span class='object_link'><a href="Receptor.html#model_name-instance_method" title="Receptor#model_name (method)">#model_name</a></span>, <span class='object_link'><a href="Receptor.html#name-instance_method" title="Receptor#name (method)">#name</a></span></p>
|
245
|
+
<div id="constructor_details" class="method_details_list">
|
246
|
+
<h2>Constructor Details</h2>
|
247
|
+
|
248
|
+
<div class="method_details first">
|
249
|
+
<h3 class="signature first" id="initialize-instance_method">
|
250
|
+
|
251
|
+
#<strong>initialize</strong>(pin, sensor_model) ⇒ <tt><span class='object_link'><a href="" title="DHTxxSensor (class)">DHTxxSensor</a></span></tt>
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
</h3><div class="docstring">
|
258
|
+
<div class="discussion">
|
259
|
+
|
260
|
+
<p>Returns a new instance of DHTxxSensor</p>
|
261
|
+
|
262
|
+
|
263
|
+
</div>
|
264
|
+
</div>
|
265
|
+
<div class="tags">
|
266
|
+
|
267
|
+
|
268
|
+
</div><table class="source_code">
|
269
|
+
<tr>
|
270
|
+
<td>
|
271
|
+
<pre class="lines">
|
272
|
+
|
273
|
+
|
274
|
+
7
|
275
|
+
8
|
276
|
+
9
|
277
|
+
10
|
278
|
+
11
|
279
|
+
12</pre>
|
280
|
+
</td>
|
281
|
+
<td>
|
282
|
+
<pre class="code"><span class="info file"># File 'lib/dht_sensor.rb', line 7</span>
|
283
|
+
|
284
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_pin'>pin</span><span class='comma'>,</span> <span class='id identifier rubyid_sensor_model'>sensor_model</span><span class='rparen'>)</span>
|
285
|
+
<span class='ivar'>@pin</span> <span class='op'>=</span> <span class='id identifier rubyid_pin'>pin</span>
|
286
|
+
<span class='ivar'>@sensor_name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>DHT</span><span class='tstring_end'>'</span></span><span class='op'>+</span><span class='id identifier rubyid_sensor_model'>sensor_model</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
|
287
|
+
<span class='ivar'>@sensor_model</span> <span class='op'>=</span> <span class='id identifier rubyid_sensor_model'>sensor_model</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
|
288
|
+
<span class='ivar'>@temperature</span><span class='comma'>,</span> <span class='ivar'>@humidity</span> <span class='op'>=</span> <span class='id identifier rubyid_read_data'>read_data</span>
|
289
|
+
<span class='kw'>end</span></pre>
|
290
|
+
</td>
|
291
|
+
</tr>
|
292
|
+
</table>
|
293
|
+
</div>
|
294
|
+
|
295
|
+
</div>
|
296
|
+
|
297
|
+
|
298
|
+
<div id="instance_method_details" class="method_details_list">
|
299
|
+
<h2>Instance Method Details</h2>
|
300
|
+
|
301
|
+
|
302
|
+
<div class="method_details first">
|
303
|
+
<h3 class="signature first" id="read_data-instance_method">
|
304
|
+
|
305
|
+
#<strong>read_data</strong> ⇒ <tt>Object</tt>
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
</h3><div class="docstring">
|
312
|
+
<div class="discussion">
|
313
|
+
|
314
|
+
<p>Read values by 'DhtSensor.read' from 'dht-sensor-ffi'</p>
|
315
|
+
|
316
|
+
|
317
|
+
</div>
|
318
|
+
</div>
|
319
|
+
<div class="tags">
|
320
|
+
|
321
|
+
|
322
|
+
</div><table class="source_code">
|
323
|
+
<tr>
|
324
|
+
<td>
|
325
|
+
<pre class="lines">
|
326
|
+
|
327
|
+
|
328
|
+
15
|
329
|
+
16
|
330
|
+
17
|
331
|
+
18
|
332
|
+
19
|
333
|
+
20</pre>
|
334
|
+
</td>
|
335
|
+
<td>
|
336
|
+
<pre class="code"><span class="info file"># File 'lib/dht_sensor.rb', line 15</span>
|
337
|
+
|
338
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_read_data'>read_data</span>
|
339
|
+
<span class='id identifier rubyid_sensor_data'>sensor_data</span> <span class='op'>=</span> <span class='const'>DhtSensor</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='ivar'>@pin</span><span class='comma'>,</span> <span class='ivar'>@sensor_model</span><span class='rparen'>)</span>
|
340
|
+
<span class='ivar'>@temperature</span> <span class='op'>=</span> <span class='id identifier rubyid_sensor_data'>sensor_data</span><span class='period'>.</span><span class='id identifier rubyid_temp'>temp</span>
|
341
|
+
<span class='ivar'>@humidity</span> <span class='op'>=</span> <span class='id identifier rubyid_sensor_data'>sensor_data</span><span class='period'>.</span><span class='id identifier rubyid_humidity'>humidity</span>
|
342
|
+
<span class='lbracket'>[</span><span class='ivar'>@temperature</span><span class='comma'>,</span> <span class='ivar'>@humidity</span><span class='rbracket'>]</span>
|
343
|
+
<span class='kw'>end</span></pre>
|
344
|
+
</td>
|
345
|
+
</tr>
|
346
|
+
</table>
|
347
|
+
</div>
|
348
|
+
|
349
|
+
</div>
|
350
|
+
|
351
|
+
</div>
|
352
|
+
|
353
|
+
<div id="footer">
|
354
|
+
Generated on Tue Dec 11 17:46:31 2018 by
|
355
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
356
|
+
0.9.16 (ruby-2.3.3).
|
357
|
+
</div>
|
358
|
+
|
359
|
+
</div>
|
360
|
+
</body>
|
361
|
+
</html>
|