raspberry_pi_iot 0.0.12 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/doc/IoT.html +6 -4
  3. data/doc/RaspberryPiIoT.html +16 -10
  4. data/doc/_index.html +197 -21
  5. data/doc/class_list.html +1 -1
  6. data/doc/file.LICENSE.html +1 -1
  7. data/doc/file.README.html +15 -6
  8. data/doc/index.html +15 -6
  9. data/doc/method_list.html +590 -30
  10. data/doc/top-level-namespace.html +2 -2
  11. data/lib/iot/bh1750.rb +6 -4
  12. data/lib/iot/receptor.rb +6 -0
  13. data/lib/raspberry_pi.rb +1 -1
  14. data/lib/raspberry_pi_iot/version.rb +1 -1
  15. data/test/test.sh +5 -0
  16. data/test/test.txt +52 -169
  17. data/test/test_bh1750.rb +5 -0
  18. data/test/test_ky008.rb +41 -0
  19. metadata +2 -29
  20. data/doc/Actuator.html +0 -145
  21. data/doc/BH1750.html +0 -541
  22. data/doc/BME280.html +0 -276
  23. data/doc/BMP280.html +0 -276
  24. data/doc/BMxSensor.html +0 -557
  25. data/doc/BinaryActuator.html +0 -177
  26. data/doc/BinaryEffector.html +0 -246
  27. data/doc/BinaryReceptor.html +0 -387
  28. data/doc/BinarySensor.html +0 -168
  29. data/doc/Bus.html +0 -126
  30. data/doc/Button.html +0 -1276
  31. data/doc/DHT11.html +0 -287
  32. data/doc/DHT22.html +0 -287
  33. data/doc/DHTxxSensor.html +0 -361
  34. data/doc/DS18B20.html +0 -339
  35. data/doc/DigitalActuator.html +0 -164
  36. data/doc/DigitalEffector.html +0 -624
  37. data/doc/DigitalReceptor.html +0 -242
  38. data/doc/DigitalSensor.html +0 -162
  39. data/doc/Effector.html +0 -257
  40. data/doc/HCSR501.html +0 -172
  41. data/doc/HumitureSensor.html +0 -453
  42. data/doc/LED.html +0 -836
  43. data/doc/MAX44009.html +0 -830
  44. data/doc/RaspberryPi.html +0 -544
  45. data/doc/Receptor.html +0 -257
  46. data/doc/Sensor.html +0 -145
  47. data/doc/TemperatureSensor.html +0 -644
@@ -1,361 +0,0 @@
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
- &mdash; 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> &raquo;
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 &amp; 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) &#x21d2; 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> &#x21d2; 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 &#39;DhtSensor.read&#39; from &#39;dht-sensor-ffi&#39;.</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) &#x21d2; <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'>&#39;</span><span class='tstring_content'>DHT</span><span class='tstring_end'>&#39;</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> &#x21d2; <tt>Object</tt>
306
-
307
-
308
-
309
-
310
-
311
- </h3><div class="docstring">
312
- <div class="discussion">
313
-
314
- <p>Read values by &#39;DhtSensor.read&#39; from &#39;dht-sensor-ffi&#39;</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 Wed Dec 26 18:10:07 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>
@@ -1,339 +0,0 @@
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: DS18B20
8
-
9
- &mdash; 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 = "DS18B20";
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> &raquo;
40
-
41
-
42
- <span class="title">DS18B20</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: DS18B20
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="TemperatureSensor.html" title="TemperatureSensor (class)">TemperatureSensor</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">DS18B20</li>
86
-
87
- </ul>
88
- <a href="#" class="inheritanceTree">show all</a>
89
-
90
- </dd>
91
- </dl>
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
-
100
-
101
-
102
-
103
- <dl>
104
- <dt>Defined in:</dt>
105
- <dd>lib/ds18b20.rb</dd>
106
- </dl>
107
-
108
- </div>
109
-
110
- <h2>Overview</h2><div class="docstring">
111
- <div class="discussion">
112
-
113
- <p>DS18B20 - high precision temperature sensor with 1-wire interface</p>
114
-
115
-
116
- </div>
117
- </div>
118
- <div class="tags">
119
-
120
-
121
- </div>
122
-
123
-
124
-
125
-
126
-
127
-
128
-
129
- <h2>
130
- Instance Method Summary
131
- <small><a href="#" class="summary_toggle">collapse</a></small>
132
- </h2>
133
-
134
- <ul class="summary">
135
-
136
- <li class="public ">
137
- <span class="summary_signature">
138
-
139
- <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(device = &#39;w1_slave&#39;) &#x21d2; DS18B20 </a>
140
-
141
-
142
-
143
- </span>
144
-
145
-
146
- <span class="note title constructor">constructor</span>
147
-
148
-
149
-
150
-
151
-
152
-
153
-
154
-
155
- <span class="summary_desc"><div class='inline'>
156
- <p>A new instance of DS18B20.</p>
157
- </div></span>
158
-
159
- </li>
160
-
161
-
162
- <li class="public ">
163
- <span class="summary_signature">
164
-
165
- <a href="#read_data-instance_method" title="#read_data (instance method)">#<strong>read_data</strong> &#x21d2; Object </a>
166
-
167
-
168
-
169
- </span>
170
-
171
-
172
-
173
-
174
-
175
-
176
-
177
-
178
-
179
- <span class="summary_desc"><div class='inline'></div></span>
180
-
181
- </li>
182
-
183
-
184
- </ul>
185
-
186
-
187
-
188
-
189
-
190
-
191
-
192
-
193
-
194
-
195
-
196
- <h3 class="inherited">Methods inherited from <span class='object_link'><a href="TemperatureSensor.html" title="TemperatureSensor (class)">TemperatureSensor</a></span></h3>
197
- <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>
198
-
199
-
200
-
201
-
202
-
203
-
204
-
205
-
206
-
207
-
208
-
209
-
210
-
211
-
212
-
213
- <h3 class="inherited">Methods inherited from <span class='object_link'><a href="DigitalReceptor.html" title="DigitalReceptor (class)">DigitalReceptor</a></span></h3>
214
- <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>
215
-
216
-
217
-
218
-
219
-
220
-
221
-
222
-
223
-
224
- <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Receptor.html" title="Receptor (class)">Receptor</a></span></h3>
225
- <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>
226
- <div id="constructor_details" class="method_details_list">
227
- <h2>Constructor Details</h2>
228
-
229
- <div class="method_details first">
230
- <h3 class="signature first" id="initialize-instance_method">
231
-
232
- #<strong>initialize</strong>(device = &#39;w1_slave&#39;) &#x21d2; <tt><span class='object_link'><a href="" title="DS18B20 (class)">DS18B20</a></span></tt>
233
-
234
-
235
-
236
-
237
-
238
- </h3><div class="docstring">
239
- <div class="discussion">
240
-
241
- <p>Returns a new instance of DS18B20</p>
242
-
243
-
244
- </div>
245
- </div>
246
- <div class="tags">
247
-
248
-
249
- </div><table class="source_code">
250
- <tr>
251
- <td>
252
- <pre class="lines">
253
-
254
-
255
- 6
256
- 7
257
- 8
258
- 9
259
- 10
260
- 11
261
- 12
262
- 13
263
- 14</pre>
264
- </td>
265
- <td>
266
- <pre class="code"><span class="info file"># File 'lib/ds18b20.rb', line 6</span>
267
-
268
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_device'>device</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>w1_slave</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
269
- <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>DS18B20</span><span class='tstring_end'>&#39;</span></span>
270
- <span class='ivar'>@sensor_file</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="DigitalReceptor.html" title="DigitalReceptor (class)">DigitalReceptor</a></span></span><span class='period'>.</span><span class='id identifier rubyid_one_wire_file'><span class='object_link'><a href="DigitalReceptor.html#one_wire_file-class_method" title="DigitalReceptor.one_wire_file (method)">one_wire_file</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>28*</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_device'>device</span><span class='rparen'>)</span>
271
- <span class='kw'>if</span> <span class='ivar'>@sensor_file</span>
272
- <span class='ivar'>@temperature</span> <span class='op'>=</span> <span class='id identifier rubyid_read_data'>read_data</span>
273
- <span class='kw'>else</span>
274
- <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'> - Sensor NOT FOUND!</span><span class='tstring_end'>&quot;</span></span>
275
- <span class='kw'>end</span>
276
- <span class='kw'>end</span></pre>
277
- </td>
278
- </tr>
279
- </table>
280
- </div>
281
-
282
- </div>
283
-
284
-
285
- <div id="instance_method_details" class="method_details_list">
286
- <h2>Instance Method Details</h2>
287
-
288
-
289
- <div class="method_details first">
290
- <h3 class="signature first" id="read_data-instance_method">
291
-
292
- #<strong>read_data</strong> &#x21d2; <tt>Object</tt>
293
-
294
-
295
-
296
-
297
-
298
- </h3><table class="source_code">
299
- <tr>
300
- <td>
301
- <pre class="lines">
302
-
303
-
304
- 16
305
- 17
306
- 18
307
- 19
308
- 20
309
- 21
310
- 22</pre>
311
- </td>
312
- <td>
313
- <pre class="code"><span class="info file"># File 'lib/ds18b20.rb', line 16</span>
314
-
315
- <span class='kw'>def</span> <span class='id identifier rubyid_read_data'>read_data</span>
316
- <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='ivar'>@sensor_file</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>r</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_f'>f</span><span class='op'>|</span>
317
- <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_f'>f</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span>
318
- <span class='ivar'>@temperature</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_scan'>scan</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>t=(\d+)</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='op'>/</span><span class='float'>1000.0</span>
319
- <span class='kw'>end</span>
320
- <span class='ivar'>@temperature</span>
321
- <span class='kw'>end</span></pre>
322
- </td>
323
- </tr>
324
- </table>
325
- </div>
326
-
327
- </div>
328
-
329
- </div>
330
-
331
- <div id="footer">
332
- Generated on Wed Dec 26 18:10:11 2018 by
333
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
334
- 0.9.16 (ruby-2.3.3).
335
- </div>
336
-
337
- </div>
338
- </body>
339
- </html>