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,830 +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: MAX44009
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 = "MAX44009";
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 (M)</a> &raquo;
40
-
41
-
42
- <span class="title">MAX44009</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: MAX44009
63
-
64
-
65
-
66
- </h1>
67
- <div class="box_info">
68
-
69
- <dl>
70
- <dt>Inherits:</dt>
71
- <dd>
72
- <span class="inheritName">Object</span>
73
-
74
- <ul class="fullTree">
75
- <li>Object</li>
76
-
77
- <li class="next">MAX44009</li>
78
-
79
- </ul>
80
- <a href="#" class="inheritanceTree">show all</a>
81
-
82
- </dd>
83
- </dl>
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
- <dl>
96
- <dt>Defined in:</dt>
97
- <dd>lib/max44009.rb</dd>
98
- </dl>
99
-
100
- </div>
101
-
102
- <h2>Overview</h2><div class="docstring">
103
- <div class="discussion">
104
-
105
- <p>MAX44009 - low-power ambient Light Sensor Output: digital, Bus: I²C, Range:
106
- 0.045..188,000 Lux, VCC: 1.7..3.6V, Operating Current: 0.65µA <a
107
- href="https://datasheets.maximintegrated.com/en/ds/MAX44009.pdf">datasheets.maximintegrated.com/en/ds/MAX44009.pdf</a></p>
108
-
109
-
110
- </div>
111
- </div>
112
- <div class="tags">
113
-
114
-
115
- </div>
116
-
117
- <h2>
118
- Constant Summary
119
- <small><a href="#" class="constants_summary_toggle">collapse</a></small>
120
- </h2>
121
-
122
- <dl class="constants">
123
-
124
- <dt id="MAX44009_DEFAULT_ADDRESS-constant" class="">MAX44009_DEFAULT_ADDRESS =
125
-
126
- </dt>
127
- <dd><pre class="code"><span class='int'>0x4A</span></pre></dd>
128
-
129
- <dt id="MAX44009_REG_INTR_STATUS-constant" class="">MAX44009_REG_INTR_STATUS =
130
- <div class="docstring">
131
- <div class="discussion">
132
-
133
- <p>MAX44009 Register Map</p>
134
-
135
-
136
- </div>
137
- </div>
138
- <div class="tags">
139
-
140
-
141
- </div>
142
- </dt>
143
- <dd><pre class="code"><span class='int'>0x00</span></pre></dd>
144
-
145
- <dt id="MAX44009_REG_INTR_ENABLE-constant" class="">MAX44009_REG_INTR_ENABLE =
146
- <div class="docstring">
147
- <div class="discussion">
148
-
149
- <p>Interrupt Status Register</p>
150
-
151
-
152
- </div>
153
- </div>
154
- <div class="tags">
155
-
156
-
157
- </div>
158
- </dt>
159
- <dd><pre class="code"><span class='int'>0x01</span></pre></dd>
160
-
161
- <dt id="MAX44009_REG_CONFIG-constant" class="">MAX44009_REG_CONFIG =
162
- <div class="docstring">
163
- <div class="discussion">
164
-
165
- <p>Interrupt Enable Register</p>
166
-
167
-
168
- </div>
169
- </div>
170
- <div class="tags">
171
-
172
-
173
- </div>
174
- </dt>
175
- <dd><pre class="code"><span class='int'>0x02</span></pre></dd>
176
-
177
- <dt id="MAX44009_REG_LUX_HIGH-constant" class="">MAX44009_REG_LUX_HIGH =
178
- <div class="docstring">
179
- <div class="discussion">
180
-
181
- <p>Configuration Register</p>
182
-
183
-
184
- </div>
185
- </div>
186
- <div class="tags">
187
-
188
-
189
- </div>
190
- </dt>
191
- <dd><pre class="code"><span class='int'>0x03</span></pre></dd>
192
-
193
- <dt id="MAX44009_REG_LUX_LOW-constant" class="">MAX44009_REG_LUX_LOW =
194
- <div class="docstring">
195
- <div class="discussion">
196
-
197
- <p>Lux High Byte</p>
198
-
199
-
200
- </div>
201
- </div>
202
- <div class="tags">
203
-
204
-
205
- </div>
206
- </dt>
207
- <dd><pre class="code"><span class='int'>0x04</span></pre></dd>
208
-
209
- <dt id="MAX44009_REG_THRES_UP_HI-constant" class="">MAX44009_REG_THRES_UP_HI =
210
- <div class="docstring">
211
- <div class="discussion">
212
-
213
- <p>Lux Low Byte</p>
214
-
215
-
216
- </div>
217
- </div>
218
- <div class="tags">
219
-
220
-
221
- </div>
222
- </dt>
223
- <dd><pre class="code"><span class='int'>0x05</span></pre></dd>
224
-
225
- <dt id="MAX44009_REG_THRES_LO_HI-constant" class="">MAX44009_REG_THRES_LO_HI =
226
- <div class="docstring">
227
- <div class="discussion">
228
-
229
- <p>Upper Threshold High Byte</p>
230
-
231
-
232
- </div>
233
- </div>
234
- <div class="tags">
235
-
236
-
237
- </div>
238
- </dt>
239
- <dd><pre class="code"><span class='int'>0x06</span></pre></dd>
240
-
241
- <dt id="MAX44009_REG_THRES_TIMER-constant" class="">MAX44009_REG_THRES_TIMER =
242
- <div class="docstring">
243
- <div class="discussion">
244
-
245
- <p>Upper Threshold Low Byte</p>
246
-
247
-
248
- </div>
249
- </div>
250
- <div class="tags">
251
-
252
-
253
- </div>
254
- </dt>
255
- <dd><pre class="code"><span class='int'>0x07</span></pre></dd>
256
-
257
- <dt id="MAX44009_REG_INTR_ENABLE_NO_ASSRT-constant" class="">MAX44009_REG_INTR_ENABLE_NO_ASSRT =
258
- <div class="docstring">
259
- <div class="discussion">
260
-
261
- <p>MAX44009 INTERRUPT ENABLE REGISTER</p>
262
-
263
-
264
- </div>
265
- </div>
266
- <div class="tags">
267
-
268
-
269
- </div>
270
- </dt>
271
- <dd><pre class="code"><span class='int'>0x00</span></pre></dd>
272
-
273
- <dt id="MAX44009_REG_INTR_ENABLE_TRIGGER-constant" class="">MAX44009_REG_INTR_ENABLE_TRIGGER =
274
- <div class="docstring">
275
- <div class="discussion">
276
-
277
- <p>The INT pin and the INTS bit are not asserted even if an interrupt event
278
- has occurred</p>
279
-
280
-
281
- </div>
282
- </div>
283
- <div class="tags">
284
-
285
-
286
- </div>
287
- </dt>
288
- <dd><pre class="code"><span class='int'>0x01</span></pre></dd>
289
-
290
- <dt id="MAX44009_REG_CONFIG_CONTMODE_DEFAULT-constant" class="">MAX44009_REG_CONFIG_CONTMODE_DEFAULT =
291
- <div class="docstring">
292
- <div class="discussion">
293
-
294
- <p>MAX44009 CONFIGURATION REGISTER</p>
295
-
296
-
297
- </div>
298
- </div>
299
- <div class="tags">
300
-
301
-
302
- </div>
303
- </dt>
304
- <dd><pre class="code"><span class='int'>0x00</span></pre></dd>
305
-
306
- <dt id="MAX44009_REG_CONFIG_CONTMODE_CONTIN-constant" class="">MAX44009_REG_CONFIG_CONTMODE_CONTIN =
307
- <div class="docstring">
308
- <div class="discussion">
309
-
310
- <p>Default mode</p>
311
-
312
-
313
- </div>
314
- </div>
315
- <div class="tags">
316
-
317
-
318
- </div>
319
- </dt>
320
- <dd><pre class="code"><span class='int'>0x80</span></pre></dd>
321
-
322
- <dt id="MAX44009_REG_CONFIG_MANUAL_DEFAULT-constant" class="">MAX44009_REG_CONFIG_MANUAL_DEFAULT =
323
- <div class="docstring">
324
- <div class="discussion">
325
-
326
- <p>Continuous mode</p>
327
-
328
-
329
- </div>
330
- </div>
331
- <div class="tags">
332
-
333
-
334
- </div>
335
- </dt>
336
- <dd><pre class="code"><span class='int'>0x00</span></pre></dd>
337
-
338
- <dt id="MAX44009_REG_CONFIG_MANUAL_MODEON-constant" class="">MAX44009_REG_CONFIG_MANUAL_MODEON =
339
- <div class="docstring">
340
- <div class="discussion">
341
-
342
- <p>Default mode of configuration is used for the IC</p>
343
-
344
-
345
- </div>
346
- </div>
347
- <div class="tags">
348
-
349
-
350
- </div>
351
- </dt>
352
- <dd><pre class="code"><span class='int'>0x40</span></pre></dd>
353
-
354
- <dt id="MAX44009_REG_CONFIG_CDR_NODIVIDED-constant" class="">MAX44009_REG_CONFIG_CDR_NODIVIDED =
355
- <div class="docstring">
356
- <div class="discussion">
357
-
358
- <p>Manual mode of configuration is used for the IC</p>
359
-
360
-
361
- </div>
362
- </div>
363
- <div class="tags">
364
-
365
-
366
- </div>
367
- </dt>
368
- <dd><pre class="code"><span class='int'>0x00</span></pre></dd>
369
-
370
- <dt id="MAX44009_REG_CONFIG_CDR_DIVIDED-constant" class="">MAX44009_REG_CONFIG_CDR_DIVIDED =
371
- <div class="docstring">
372
- <div class="discussion">
373
-
374
- <p>Current not divided. All of the photodiode current goes to the ADC</p>
375
-
376
-
377
- </div>
378
- </div>
379
- <div class="tags">
380
-
381
-
382
- </div>
383
- </dt>
384
- <dd><pre class="code"><span class='int'>0x08</span></pre></dd>
385
-
386
- <dt id="MAX44009_REG_CONFIG_INTRTIMER_800-constant" class="">MAX44009_REG_CONFIG_INTRTIMER_800 =
387
- <div class="docstring">
388
- <div class="discussion">
389
-
390
- <p>Current divided by 8</p>
391
-
392
-
393
- </div>
394
- </div>
395
- <div class="tags">
396
-
397
-
398
- </div>
399
- </dt>
400
- <dd><pre class="code"><span class='int'>0x00</span></pre></dd>
401
-
402
- <dt id="MAX44009_REG_CONFIG_INTRTIMER_400-constant" class="">MAX44009_REG_CONFIG_INTRTIMER_400 =
403
- <div class="docstring">
404
- <div class="discussion">
405
-
406
- <p>Integration Time = 800ms, This is a preferred mode for boosting low-light
407
- sensitivity</p>
408
-
409
-
410
- </div>
411
- </div>
412
- <div class="tags">
413
-
414
-
415
- </div>
416
- </dt>
417
- <dd><pre class="code"><span class='int'>0x01</span></pre></dd>
418
-
419
- <dt id="MAX44009_REG_CONFIG_INTRTIMER_200-constant" class="">MAX44009_REG_CONFIG_INTRTIMER_200 =
420
- <div class="docstring">
421
- <div class="discussion">
422
-
423
- <p>Integration Time = 400ms</p>
424
-
425
-
426
- </div>
427
- </div>
428
- <div class="tags">
429
-
430
-
431
- </div>
432
- </dt>
433
- <dd><pre class="code"><span class='int'>0x02</span></pre></dd>
434
-
435
- <dt id="MAX44009_REG_CONFIG_INTRTIMER_100-constant" class="">MAX44009_REG_CONFIG_INTRTIMER_100 =
436
- <div class="docstring">
437
- <div class="discussion">
438
-
439
- <p>Integration Time = 200ms</p>
440
-
441
-
442
- </div>
443
- </div>
444
- <div class="tags">
445
-
446
-
447
- </div>
448
- </dt>
449
- <dd><pre class="code"><span class='int'>0x03</span></pre></dd>
450
-
451
- <dt id="MAX44009_REG_CONFIG_INTRTIMER_50-constant" class="">MAX44009_REG_CONFIG_INTRTIMER_50 =
452
- <div class="docstring">
453
- <div class="discussion">
454
-
455
- <p>Integration Time = 100ms, This is a preferred mode for high-brightness
456
- applications</p>
457
-
458
-
459
- </div>
460
- </div>
461
- <div class="tags">
462
-
463
-
464
- </div>
465
- </dt>
466
- <dd><pre class="code"><span class='int'>0x04</span></pre></dd>
467
-
468
- <dt id="MAX44009_REG_CONFIG_INTRTIMER_25-constant" class="">MAX44009_REG_CONFIG_INTRTIMER_25 =
469
- <div class="docstring">
470
- <div class="discussion">
471
-
472
- <p>Integration Time = 50ms, Manual Mode only</p>
473
-
474
-
475
- </div>
476
- </div>
477
- <div class="tags">
478
-
479
-
480
- </div>
481
- </dt>
482
- <dd><pre class="code"><span class='int'>0x05</span></pre></dd>
483
-
484
- <dt id="MAX44009_REG_CONFIG_INTRTIMER_12_5-constant" class="">MAX44009_REG_CONFIG_INTRTIMER_12_5 =
485
- <div class="docstring">
486
- <div class="discussion">
487
-
488
- <p>Integration Time = 25ms, Manual Mode only</p>
489
-
490
-
491
- </div>
492
- </div>
493
- <div class="tags">
494
-
495
-
496
- </div>
497
- </dt>
498
- <dd><pre class="code"><span class='int'>0x06</span></pre></dd>
499
-
500
- <dt id="MAX44009_REG_CONFIG_INTRTIMER_6_25-constant" class="">MAX44009_REG_CONFIG_INTRTIMER_6_25 =
501
- <div class="docstring">
502
- <div class="discussion">
503
-
504
- <p>Integration Time = 12.5ms, Manual Mode only</p>
505
-
506
-
507
- </div>
508
- </div>
509
- <div class="tags">
510
-
511
-
512
- </div>
513
- </dt>
514
- <dd><pre class="code"><span class='int'>0x07</span></pre></dd>
515
-
516
- <dt id="DEVICE-constant" class="">DEVICE =
517
- <div class="docstring">
518
- <div class="discussion">
519
-
520
- <p>Integration Time = 6.25ms, Manual Mode only</p>
521
-
522
-
523
- </div>
524
- </div>
525
- <div class="tags">
526
-
527
-
528
- </div>
529
- </dt>
530
- <dd><pre class="code"><span class='const'><span class='object_link'><a href="#MAX44009_DEFAULT_ADDRESS-constant" title="MAX44009::MAX44009_DEFAULT_ADDRESS (constant)">MAX44009_DEFAULT_ADDRESS</a></span></span></pre></dd>
531
-
532
- </dl>
533
-
534
-
535
-
536
-
537
-
538
-
539
-
540
-
541
-
542
- <h2>
543
- Instance Method Summary
544
- <small><a href="#" class="summary_toggle">collapse</a></small>
545
- </h2>
546
-
547
- <ul class="summary">
548
-
549
- <li class="public ">
550
- <span class="summary_signature">
551
-
552
- <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(i2c_bus = &#39;/dev/i2c-1&#39;) &#x21d2; MAX44009 </a>
553
-
554
-
555
-
556
- </span>
557
-
558
-
559
- <span class="note title constructor">constructor</span>
560
-
561
-
562
-
563
-
564
-
565
-
566
-
567
-
568
- <span class="summary_desc"><div class='inline'>
569
- <p>I2C sensor address.</p>
570
- </div></span>
571
-
572
- </li>
573
-
574
-
575
- <li class="public ">
576
- <span class="summary_signature">
577
-
578
- <a href="#lux-instance_method" title="#lux (instance method)">#<strong>lux</strong> &#x21d2; Object </a>
579
-
580
-
581
-
582
- </span>
583
-
584
-
585
-
586
-
587
-
588
-
589
-
590
-
591
-
592
- <span class="summary_desc"><div class='inline'>
593
- <p>Return.</p>
594
- </div></span>
595
-
596
- </li>
597
-
598
-
599
- <li class="public ">
600
- <span class="summary_signature">
601
-
602
- <a href="#read_sensor-instance_method" title="#read_sensor (instance method)">#<strong>read_sensor</strong> &#x21d2; Object </a>
603
-
604
-
605
-
606
- </span>
607
-
608
-
609
-
610
-
611
-
612
-
613
-
614
-
615
-
616
- <span class="summary_desc"><div class='inline'></div></span>
617
-
618
- </li>
619
-
620
-
621
- <li class="public ">
622
- <span class="summary_signature">
623
-
624
- <a href="#write_config-instance_method" title="#write_config (instance method)">#<strong>write_config</strong> &#x21d2; Object </a>
625
-
626
-
627
-
628
- </span>
629
-
630
-
631
-
632
-
633
-
634
-
635
-
636
-
637
-
638
- <span class="summary_desc"><div class='inline'></div></span>
639
-
640
- </li>
641
-
642
-
643
- </ul>
644
-
645
-
646
- <div id="constructor_details" class="method_details_list">
647
- <h2>Constructor Details</h2>
648
-
649
- <div class="method_details first">
650
- <h3 class="signature first" id="initialize-instance_method">
651
-
652
- #<strong>initialize</strong>(i2c_bus = &#39;/dev/i2c-1&#39;) &#x21d2; <tt><span class='object_link'><a href="" title="MAX44009 (class)">MAX44009</a></span></tt>
653
-
654
-
655
-
656
-
657
-
658
- </h3><div class="docstring">
659
- <div class="discussion">
660
-
661
- <p>I2C sensor address</p>
662
-
663
-
664
- </div>
665
- </div>
666
- <div class="tags">
667
-
668
-
669
- </div><table class="source_code">
670
- <tr>
671
- <td>
672
- <pre class="lines">
673
-
674
-
675
- 38
676
- 39
677
- 40
678
- 41
679
- 42
680
- 43
681
- 44
682
- 45</pre>
683
- </td>
684
- <td>
685
- <pre class="code"><span class="info file"># File 'lib/max44009.rb', line 38</span>
686
-
687
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_i2c_bus'>i2c_bus</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/dev/i2c-1</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
688
- <span class='ivar'>@sensor_name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>MAX44009</span><span class='tstring_end'>&#39;</span></span>
689
- <span class='ivar'>@i2c_bus</span> <span class='op'>=</span> <span class='id identifier rubyid_i2c_bus'>i2c_bus</span>
690
- <span class='ivar'>@device</span> <span class='op'>=</span> <span class='const'>I2CDevice</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='label'>address:</span> <span class='const'><span class='object_link'><a href="#DEVICE-constant" title="MAX44009::DEVICE (constant)">DEVICE</a></span></span><span class='comma'>,</span> <span class='label'>driver:</span> <span class='const'>I2CDevice</span><span class='op'>::</span><span class='const'>Driver</span><span class='op'>::</span><span class='const'>I2CDev</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@i2c_bus</span><span class='rparen'>)</span><span class='rparen'>)</span>
691
- <span class='id identifier rubyid_write_config'>write_config</span><span class='lparen'>(</span><span class='rparen'>)</span>
692
- <span class='ivar'>@length</span> <span class='op'>=</span> <span class='int'>2</span>
693
- <span class='ivar'>@value</span> <span class='op'>=</span> <span class='id identifier rubyid_read_sensor'>read_sensor</span>
694
- <span class='kw'>end</span></pre>
695
- </td>
696
- </tr>
697
- </table>
698
- </div>
699
-
700
- </div>
701
-
702
-
703
- <div id="instance_method_details" class="method_details_list">
704
- <h2>Instance Method Details</h2>
705
-
706
-
707
- <div class="method_details first">
708
- <h3 class="signature first" id="lux-instance_method">
709
-
710
- #<strong>lux</strong> &#x21d2; <tt>Object</tt>
711
-
712
-
713
-
714
-
715
-
716
- </h3><div class="docstring">
717
- <div class="discussion">
718
-
719
- <p>Return</p>
720
-
721
-
722
- </div>
723
- </div>
724
- <div class="tags">
725
-
726
-
727
- </div><table class="source_code">
728
- <tr>
729
- <td>
730
- <pre class="lines">
731
-
732
-
733
- 60
734
- 61
735
- 62
736
- 63</pre>
737
- </td>
738
- <td>
739
- <pre class="code"><span class="info file"># File 'lib/max44009.rb', line 60</span>
740
-
741
- <span class='kw'>def</span> <span class='id identifier rubyid_lux'>lux</span>
742
- <span class='id identifier rubyid_read_sensor'>read_sensor</span>
743
- <span class='ivar'>@value</span>
744
- <span class='kw'>end</span></pre>
745
- </td>
746
- </tr>
747
- </table>
748
- </div>
749
-
750
- <div class="method_details ">
751
- <h3 class="signature " id="read_sensor-instance_method">
752
-
753
- #<strong>read_sensor</strong> &#x21d2; <tt>Object</tt>
754
-
755
-
756
-
757
-
758
-
759
- </h3><table class="source_code">
760
- <tr>
761
- <td>
762
- <pre class="lines">
763
-
764
-
765
- 53
766
- 54
767
- 55
768
- 56
769
- 57</pre>
770
- </td>
771
- <td>
772
- <pre class="code"><span class="info file"># File 'lib/max44009.rb', line 53</span>
773
-
774
- <span class='kw'>def</span> <span class='id identifier rubyid_read_sensor'>read_sensor</span>
775
- <span class='comment'># Read data back from MAX44009_REG_LUX_HIGH(0x03), 2 bytes, luminance MSB, luminance LSB
776
- </span> <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='ivar'>@device</span><span class='period'>.</span><span class='id identifier rubyid_i2cget'>i2cget</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#MAX44009_REG_LUX_HIGH-constant" title="MAX44009::MAX44009_REG_LUX_HIGH (constant)">MAX44009_REG_LUX_HIGH</a></span></span><span class='comma'>,</span> <span class='int'>2</span><span class='rparen'>)</span>
777
- <span class='ivar'>@value</span> <span class='op'>=</span> <span class='id identifier rubyid_data_to_lux'>data_to_lux</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
778
- <span class='kw'>end</span></pre>
779
- </td>
780
- </tr>
781
- </table>
782
- </div>
783
-
784
- <div class="method_details ">
785
- <h3 class="signature " id="write_config-instance_method">
786
-
787
- #<strong>write_config</strong> &#x21d2; <tt>Object</tt>
788
-
789
-
790
-
791
-
792
-
793
- </h3><table class="source_code">
794
- <tr>
795
- <td>
796
- <pre class="lines">
797
-
798
-
799
- 47
800
- 48
801
- 49
802
- 50
803
- 51</pre>
804
- </td>
805
- <td>
806
- <pre class="code"><span class="info file"># File 'lib/max44009.rb', line 47</span>
807
-
808
- <span class='kw'>def</span> <span class='id identifier rubyid_write_config'>write_config</span><span class='lparen'>(</span><span class='rparen'>)</span>
809
- <span class='comment'># Select the configuration register data from the given provided values
810
- </span> <span class='id identifier rubyid_config'>config</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#MAX44009_REG_CONFIG_CONTMODE_CONTIN-constant" title="MAX44009::MAX44009_REG_CONFIG_CONTMODE_CONTIN (constant)">MAX44009_REG_CONFIG_CONTMODE_CONTIN</a></span></span> <span class='op'>|</span> <span class='const'><span class='object_link'><a href="#MAX44009_REG_CONFIG_MANUAL_MODEON-constant" title="MAX44009::MAX44009_REG_CONFIG_MANUAL_MODEON (constant)">MAX44009_REG_CONFIG_MANUAL_MODEON</a></span></span> <span class='op'>|</span> <span class='const'><span class='object_link'><a href="#MAX44009_REG_CONFIG_CDR_NODIVIDED-constant" title="MAX44009::MAX44009_REG_CONFIG_CDR_NODIVIDED (constant)">MAX44009_REG_CONFIG_CDR_NODIVIDED</a></span></span> <span class='op'>|</span> <span class='const'><span class='object_link'><a href="#MAX44009_REG_CONFIG_INTRTIMER_800-constant" title="MAX44009::MAX44009_REG_CONFIG_INTRTIMER_800 (constant)">MAX44009_REG_CONFIG_INTRTIMER_800</a></span></span><span class='rparen'>)</span>
811
- <span class='ivar'>@device</span><span class='period'>.</span><span class='id identifier rubyid_i2cset'>i2cset</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#MAX44009_REG_CONFIG-constant" title="MAX44009::MAX44009_REG_CONFIG (constant)">MAX44009_REG_CONFIG</a></span></span><span class='comma'>,</span> <span class='id identifier rubyid_config'>config</span><span class='rparen'>)</span>
812
- <span class='kw'>end</span></pre>
813
- </td>
814
- </tr>
815
- </table>
816
- </div>
817
-
818
- </div>
819
-
820
- </div>
821
-
822
- <div id="footer">
823
- Generated on Wed Dec 26 18:10:14 2018 by
824
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
825
- 0.9.16 (ruby-2.3.3).
826
- </div>
827
-
828
- </div>
829
- </body>
830
- </html>