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,557 +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: BMxSensor
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 = "BMxSensor";
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 (B)</a> &raquo;
40
-
41
-
42
- <span class="title">BMxSensor</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: BMxSensor
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">BMxSensor</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/bmx_sensor.rb</dd>
108
- </dl>
109
-
110
- </div>
111
-
112
- <h2>Overview</h2><div class="docstring">
113
- <div class="discussion">
114
-
115
- <p>BMP/BME humidity, temperature &amp; atmospheric pressure 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="BME280.html" title="BME280 (class)">BME280</a></span>, <span class='object_link'><a href="BMP280.html" title="BMP280 (class)">BMP280</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="#hPa-instance_method" title="#hPa (instance method)">#<strong>hPa</strong> &#x21d2; Object </a>
146
-
147
-
148
-
149
- </span>
150
-
151
-
152
-
153
-
154
-
155
-
156
-
157
-
158
-
159
- <span class="summary_desc"><div class='inline'>
160
- <p>standard atmospheric pressure @ sea level = 1.01325 bar = 1013.25 mbar =
161
- 101.325 kPa.</p>
162
- </div></span>
163
-
164
- </li>
165
-
166
-
167
- <li class="public ">
168
- <span class="summary_signature">
169
-
170
- <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(sensor_name, bus = 1) &#x21d2; BMxSensor </a>
171
-
172
-
173
-
174
- </span>
175
-
176
-
177
- <span class="note title constructor">constructor</span>
178
-
179
-
180
-
181
-
182
-
183
-
184
-
185
-
186
- <span class="summary_desc"><div class='inline'>
187
- <p>A new instance of BMxSensor.</p>
188
- </div></span>
189
-
190
- </li>
191
-
192
-
193
- <li class="public ">
194
- <span class="summary_signature">
195
-
196
- <a href="#pressure-instance_method" title="#pressure (instance method)">#<strong>pressure</strong>(mode = :hPa) &#x21d2; Object </a>
197
-
198
-
199
-
200
- </span>
201
-
202
-
203
-
204
-
205
-
206
-
207
-
208
-
209
-
210
- <span class="summary_desc"><div class='inline'></div></span>
211
-
212
- </li>
213
-
214
-
215
- <li class="public ">
216
- <span class="summary_signature">
217
-
218
- <a href="#read_data-instance_method" title="#read_data (instance method)">#<strong>read_data</strong> &#x21d2; Object </a>
219
-
220
-
221
-
222
- </span>
223
-
224
-
225
-
226
-
227
-
228
-
229
-
230
-
231
-
232
- <span class="summary_desc"><div class='inline'></div></span>
233
-
234
- </li>
235
-
236
-
237
- <li class="public ">
238
- <span class="summary_signature">
239
-
240
- <a href="#to_s-instance_method" title="#to_s (instance method)">#<strong>to_s</strong> &#x21d2; Object </a>
241
-
242
-
243
-
244
- </span>
245
-
246
-
247
-
248
-
249
-
250
-
251
-
252
-
253
-
254
- <span class="summary_desc"><div class='inline'></div></span>
255
-
256
- </li>
257
-
258
-
259
- </ul>
260
-
261
-
262
-
263
-
264
-
265
-
266
-
267
-
268
-
269
-
270
-
271
- <h3 class="inherited">Methods inherited from <span class='object_link'><a href="HumitureSensor.html" title="HumitureSensor (class)">HumitureSensor</a></span></h3>
272
- <p class="inherited"><span class='object_link'><a href="HumitureSensor.html#humidity-instance_method" title="HumitureSensor#humidity (method)">#humidity</a></span></p>
273
-
274
-
275
-
276
-
277
-
278
-
279
-
280
-
281
-
282
- <h3 class="inherited">Methods inherited from <span class='object_link'><a href="TemperatureSensor.html" title="TemperatureSensor (class)">TemperatureSensor</a></span></h3>
283
- <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></p>
284
-
285
-
286
-
287
-
288
-
289
-
290
-
291
-
292
-
293
-
294
-
295
-
296
-
297
-
298
-
299
- <h3 class="inherited">Methods inherited from <span class='object_link'><a href="DigitalReceptor.html" title="DigitalReceptor (class)">DigitalReceptor</a></span></h3>
300
- <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>
301
-
302
-
303
-
304
-
305
-
306
-
307
-
308
-
309
-
310
- <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Receptor.html" title="Receptor (class)">Receptor</a></span></h3>
311
- <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>
312
- <div id="constructor_details" class="method_details_list">
313
- <h2>Constructor Details</h2>
314
-
315
- <div class="method_details first">
316
- <h3 class="signature first" id="initialize-instance_method">
317
-
318
- #<strong>initialize</strong>(sensor_name, bus = 1) &#x21d2; <tt><span class='object_link'><a href="" title="BMxSensor (class)">BMxSensor</a></span></tt>
319
-
320
-
321
-
322
-
323
-
324
- </h3><div class="docstring">
325
- <div class="discussion">
326
-
327
- <p>Returns a new instance of BMxSensor</p>
328
-
329
-
330
- </div>
331
- </div>
332
- <div class="tags">
333
-
334
-
335
- </div><table class="source_code">
336
- <tr>
337
- <td>
338
- <pre class="lines">
339
-
340
-
341
- 10
342
- 11
343
- 12
344
- 13
345
- 14</pre>
346
- </td>
347
- <td>
348
- <pre class="code"><span class="info file"># File 'lib/bmx_sensor.rb', line 10</span>
349
-
350
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_sensor_name'>sensor_name</span><span class='comma'>,</span> <span class='id identifier rubyid_bus'>bus</span><span class='op'>=</span><span class='int'>1</span><span class='rparen'>)</span>
351
- <span class='ivar'>@sensor_name</span> <span class='op'>=</span> <span class='id identifier rubyid_sensor_name'>sensor_name</span>
352
- <span class='ivar'>@sensor</span> <span class='op'>=</span> <span class='const'>I2C</span><span class='op'>::</span><span class='const'>Driver</span><span class='op'>::</span><span class='const'>BME280</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>device:</span> <span class='id identifier rubyid_bus'>bus</span><span class='rparen'>)</span>
353
- <span class='ivar'>@temperature</span><span class='comma'>,</span> <span class='ivar'>@humidity</span><span class='comma'>,</span> <span class='ivar'>@pressure</span> <span class='op'>=</span> <span class='id identifier rubyid_read_data'>read_data</span>
354
- <span class='kw'>end</span></pre>
355
- </td>
356
- </tr>
357
- </table>
358
- </div>
359
-
360
- </div>
361
-
362
-
363
- <div id="instance_method_details" class="method_details_list">
364
- <h2>Instance Method Details</h2>
365
-
366
-
367
- <div class="method_details first">
368
- <h3 class="signature first" id="hPa-instance_method">
369
-
370
- #<strong>hPa</strong> &#x21d2; <tt>Object</tt>
371
-
372
-
373
-
374
-
375
-
376
- </h3><div class="docstring">
377
- <div class="discussion">
378
-
379
- <p>standard atmospheric pressure @ sea level = 1.01325 bar = 1013.25 mbar =
380
- 101.325 kPa</p>
381
-
382
-
383
- </div>
384
- </div>
385
- <div class="tags">
386
-
387
-
388
- </div><table class="source_code">
389
- <tr>
390
- <td>
391
- <pre class="lines">
392
-
393
-
394
- 25
395
- 26
396
- 27</pre>
397
- </td>
398
- <td>
399
- <pre class="code"><span class="info file"># File 'lib/bmx_sensor.rb', line 25</span>
400
-
401
- <span class='kw'>def</span> <span class='id identifier rubyid_hPa'>hPa</span>
402
- <span class='ivar'>@pressure</span>
403
- <span class='kw'>end</span></pre>
404
- </td>
405
- </tr>
406
- </table>
407
- </div>
408
-
409
- <div class="method_details ">
410
- <h3 class="signature " id="pressure-instance_method">
411
-
412
- #<strong>pressure</strong>(mode = :hPa) &#x21d2; <tt>Object</tt>
413
-
414
-
415
-
416
-
417
-
418
- </h3><table class="source_code">
419
- <tr>
420
- <td>
421
- <pre class="lines">
422
-
423
-
424
- 29
425
- 30
426
- 31
427
- 32
428
- 33
429
- 34
430
- 35
431
- 36
432
- 37
433
- 38
434
- 39
435
- 40
436
- 41
437
- 42
438
- 43
439
- 44
440
- 45
441
- 46
442
- 47
443
- 48
444
- 49
445
- 50</pre>
446
- </td>
447
- <td>
448
- <pre class="code"><span class="info file"># File 'lib/bmx_sensor.rb', line 29</span>
449
-
450
- <span class='kw'>def</span> <span class='id identifier rubyid_pressure'>pressure</span><span class='lparen'>(</span><span class='id identifier rubyid_mode'>mode</span><span class='op'>=</span><span class='symbol'>:hPa</span><span class='rparen'>)</span>
451
- <span class='kw'>case</span> <span class='id identifier rubyid_mode'>mode</span>
452
- <span class='kw'>when</span> <span class='symbol'>:hPa</span> <span class='comment'># 1 hPa = 100 Pa = 1 mbar = 1 hPa = 0.750062 mmHg [@ 0°C]
453
- </span> <span class='id identifier rubyid_hPa'>hPa</span>
454
- <span class='kw'>when</span> <span class='symbol'>:kPa</span> <span class='comment'># 1 kPa = 1000 Pa = 10 hPa
455
- </span> <span class='id identifier rubyid_hPa'>hPa</span> <span class='op'>/</span> <span class='float'>10.0</span>
456
- <span class='kw'>when</span> <span class='symbol'>:Pa</span> <span class='comment'># 1 Pa = 0.01 hPa = 0.001 kPa
457
- </span> <span class='id identifier rubyid_hPa'>hPa</span> <span class='op'>*</span> <span class='float'>100.0</span>
458
- <span class='kw'>when</span> <span class='symbol'>:mmHg</span> <span class='comment'># 1 mmHg = 1.3332236842105263 hPa = 133.322387415 Pa = 1.000000142466321... Torr
459
- </span> <span class='id identifier rubyid_hPa'>hPa</span> <span class='op'>/</span> <span class='lparen'>(</span><span class='float'>1013.25</span> <span class='op'>/</span> <span class='int'>760</span><span class='rparen'>)</span> <span class='comment'># 760 mmHg = 101.3250144354 kPa
460
- </span> <span class='kw'>when</span> <span class='symbol'>:atm</span> <span class='comment'># 1 atm = 101325 Pa = 101.325 kPa
461
- </span> <span class='id identifier rubyid_hPa'>hPa</span> <span class='op'>/</span> <span class='float'>1013.25</span>
462
- <span class='kw'>when</span> <span class='symbol'>:bar</span> <span class='comment'># 1 bar ≡ 100000 Pa = 1000 hPa = 0.987 atm = 750.06 mmHg = 750.06 Torr
463
- </span> <span class='id identifier rubyid_hPa'>hPa</span> <span class='op'>/</span> <span class='float'>1000.0</span>
464
- <span class='kw'>when</span> <span class='symbol'>:mbar</span> <span class='comment'># 1 mbar = 0.001 bar
465
- </span> <span class='id identifier rubyid_bar'>bar</span> <span class='op'>*</span> <span class='float'>1000.0</span>
466
- <span class='kw'>when</span> <span class='symbol'>:Torr</span> <span class='comment'># 1 Torr = 1/760 atm = 101325/760 Pa = 0.999999857533699... mmHg
467
- </span> <span class='lparen'>(</span><span class='id identifier rubyid_hPa'>hPa</span> <span class='op'>/</span> <span class='float'>1013.25</span><span class='rparen'>)</span> <span class='op'>/</span> <span class='int'>760</span>
468
- <span class='kw'>else</span>
469
- <span class='id identifier rubyid_hPa'>hPa</span>
470
- <span class='kw'>end</span>
471
- <span class='kw'>end</span></pre>
472
- </td>
473
- </tr>
474
- </table>
475
- </div>
476
-
477
- <div class="method_details ">
478
- <h3 class="signature " id="read_data-instance_method">
479
-
480
- #<strong>read_data</strong> &#x21d2; <tt>Object</tt>
481
-
482
-
483
-
484
-
485
-
486
- </h3><table class="source_code">
487
- <tr>
488
- <td>
489
- <pre class="lines">
490
-
491
-
492
- 16
493
- 17
494
- 18
495
- 19
496
- 20
497
- 21
498
- 22</pre>
499
- </td>
500
- <td>
501
- <pre class="code"><span class="info file"># File 'lib/bmx_sensor.rb', line 16</span>
502
-
503
- <span class='kw'>def</span> <span class='id identifier rubyid_read_data'>read_data</span>
504
- <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='ivar'>@sensor</span><span class='period'>.</span><span class='id identifier rubyid_all'>all</span>
505
- <span class='ivar'>@temperature</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='symbol'>:t</span><span class='rbracket'>]</span>
506
- <span class='ivar'>@pressure</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='symbol'>:p</span><span class='rbracket'>]</span>
507
- <span class='ivar'>@humidity</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='symbol'>:h</span><span class='rbracket'>]</span>
508
- <span class='lbracket'>[</span><span class='ivar'>@temperature</span><span class='comma'>,</span> <span class='ivar'>@humidity</span><span class='comma'>,</span> <span class='ivar'>@pressure</span><span class='rbracket'>]</span>
509
- <span class='kw'>end</span></pre>
510
- </td>
511
- </tr>
512
- </table>
513
- </div>
514
-
515
- <div class="method_details ">
516
- <h3 class="signature " id="to_s-instance_method">
517
-
518
- #<strong>to_s</strong> &#x21d2; <tt>Object</tt>
519
-
520
-
521
-
522
-
523
-
524
- </h3><table class="source_code">
525
- <tr>
526
- <td>
527
- <pre class="lines">
528
-
529
-
530
- 52
531
- 53
532
- 54</pre>
533
- </td>
534
- <td>
535
- <pre class="code"><span class="info file"># File 'lib/bmx_sensor.rb', line 52</span>
536
-
537
- <span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span>
538
- <span class='id identifier rubyid_sprintf'>sprintf</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%5.2f°C, %5.2f %%, %5.2f mmHg</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='ivar'>@temperature</span><span class='comma'>,</span> <span class='ivar'>@humidity</span><span class='comma'>,</span> <span class='id identifier rubyid_pressure'>pressure</span><span class='lparen'>(</span><span class='symbol'>:mmHg</span><span class='rparen'>)</span>
539
- <span class='kw'>end</span></pre>
540
- </td>
541
- </tr>
542
- </table>
543
- </div>
544
-
545
- </div>
546
-
547
- </div>
548
-
549
- <div id="footer">
550
- Generated on Wed Dec 26 18:10:03 2018 by
551
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
552
- 0.9.16 (ruby-2.3.3).
553
- </div>
554
-
555
- </div>
556
- </body>
557
- </html>