raspberry_pi_iot 0.0.6 → 0.0.11
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.
- checksums.yaml +5 -5
- data/doc/Actuator.html +1 -1
- data/doc/BH1750.html +22 -16
- data/doc/BME280.html +5 -5
- data/doc/BMP280.html +5 -5
- data/doc/BMxSensor.html +24 -26
- data/doc/BinaryActuator.html +3 -3
- data/doc/BinaryEffector.html +1 -1
- data/doc/BinaryReceptor.html +1 -1
- data/doc/BinarySensor.html +2 -2
- data/doc/Bus.html +1 -1
- data/doc/Button.html +344 -54
- data/doc/DHT11.html +1 -1
- data/doc/DHT22.html +1 -1
- data/doc/DHTxxSensor.html +1 -1
- data/doc/DS18B20.html +2 -2
- data/doc/DigitalActuator.html +3 -3
- data/doc/DigitalEffector.html +17 -29
- data/doc/DigitalReceptor.html +1 -1
- data/doc/DigitalSensor.html +2 -2
- data/doc/Effector.html +1 -1
- data/doc/HCSR501.html +1 -1
- data/doc/HumitureSensor.html +1 -1
- data/doc/IoT.html +12 -2
- data/doc/LED.html +99 -47
- data/doc/MAX44009.html +1 -1
- data/doc/RaspberryPi.html +258 -23
- data/doc/Receptor.html +1 -1
- data/doc/Sensor.html +1 -1
- data/doc/TemperatureSensor.html +1 -1
- data/doc/_index.html +32 -1
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +133 -0
- data/doc/file_list.html +10 -0
- data/doc/index.html +71 -317
- data/doc/method_list.html +126 -62
- data/doc/top-level-namespace.html +2 -2
- data/lib/bh1750.rb +9 -2
- data/lib/binary_actuator.rb +5 -0
- data/lib/binary_effector.rb +0 -4
- data/lib/binary_receptor.rb +0 -4
- data/lib/binary_sensor.rb +5 -0
- data/lib/bmx_sensor.rb +12 -25
- data/lib/bmx_sensor.rb.OLD +74 -0
- data/lib/bus.rb +25 -1
- data/lib/button.rb +34 -6
- data/lib/dht_sensor.rb +4 -0
- data/lib/digital_actuator.rb +5 -0
- data/lib/digital_effector.rb +23 -16
- data/lib/digital_receptor.rb +0 -4
- data/lib/digital_sensor.rb +5 -0
- data/lib/ds18b20.rb +1 -1
- data/lib/hcsr501.rb +1 -1
- data/lib/iot.rb +15 -0
- data/lib/led.rb +4 -0
- data/lib/led_rgb.rb +28 -44
- data/lib/max44009.rb +5 -0
- data/lib/raspberry_pi.rb +54 -19
- data/lib/raspberry_pi_iot.rb +8 -0
- data/lib/temperature_sensor.rb +1 -1
- data/lib/thermal_sensor.rb +1 -1
- data/test/-test_bme280.rb +59 -0
- data/test/-test_bmp280.rb +54 -0
- data/test/test_Raspberry_Pi_IoT.rb +11 -0
- data/test/test_bh1750.rb +31 -0
- data/test/test_button.rb +52 -0
- data/test/test_dht11.rb +35 -0
- data/test/test_dht22.rb +35 -0
- data/test/test_ds18b20.rb +28 -0
- data/test/test_helper.rb +4 -0
- data/test/test_info.rb +44 -0
- data/test/test_led.rb +46 -0
- data/test/test_led_rgb.rb +85 -0
- data/test/test_max44009_gy49.rb +31 -0
- data/test/test_thermal.rb +27 -0
- metadata +87 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: b5dfdc617f598658a421bec8deb1b11237cc391bc76c4eb9b7f64fb253f053ca
|
|
4
|
+
data.tar.gz: 28cd3de80cb85f4e22e6188e23775a58045c5679aff0d0b17e204b4959e2e7a0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 12371ba7e697be7e635563e81b10349e93b1de197b9043ecab3fbb3dd8c6ac606c7b3086c0bc7318fa3518bfebd6f1076b88bfe7a0e41b38fcf04bc2b622cd0f
|
|
7
|
+
data.tar.gz: 71e1ed94b315807c4096ea942a16cc1a40cc55a95cff4c67e67da642b4cf305eb3654630c0942140bdb1e91fb9532de9ff1e9cb3a088ebd36d3d8eb474f11aa4
|
data/doc/Actuator.html
CHANGED
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
</div>
|
|
136
136
|
|
|
137
137
|
<div id="footer">
|
|
138
|
-
Generated on
|
|
138
|
+
Generated on Wed Dec 26 18:10:11 2018 by
|
|
139
139
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
140
140
|
0.9.16 (ruby-2.3.3).
|
|
141
141
|
</div>
|
data/doc/BH1750.html
CHANGED
|
@@ -299,7 +299,7 @@
|
|
|
299
299
|
<li class="public ">
|
|
300
300
|
<span class="summary_signature">
|
|
301
301
|
|
|
302
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(
|
|
302
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(device_address = DEVICE, bus_number = 1) ⇒ BH1750 </a>
|
|
303
303
|
|
|
304
304
|
|
|
305
305
|
|
|
@@ -379,7 +379,7 @@
|
|
|
379
379
|
<div class="method_details first">
|
|
380
380
|
<h3 class="signature first" id="initialize-instance_method">
|
|
381
381
|
|
|
382
|
-
#<strong>initialize</strong>(
|
|
382
|
+
#<strong>initialize</strong>(device_address = DEVICE, bus_number = 1) ⇒ <tt><span class='object_link'><a href="" title="BH1750 (class)">BH1750</a></span></tt>
|
|
383
383
|
|
|
384
384
|
|
|
385
385
|
|
|
@@ -409,14 +409,20 @@
|
|
|
409
409
|
21
|
|
410
410
|
22
|
|
411
411
|
23
|
|
412
|
-
24
|
|
412
|
+
24
|
|
413
|
+
25
|
|
414
|
+
26
|
|
415
|
+
27</pre>
|
|
413
416
|
</td>
|
|
414
417
|
<td>
|
|
415
418
|
<pre class="code"><span class="info file"># File 'lib/bh1750.rb', line 17</span>
|
|
416
419
|
|
|
417
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier
|
|
420
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_device_address'>device_address</span><span class='op'>=</span><span class='const'>DEVICE</span><span class='comma'>,</span> <span class='id identifier rubyid_bus_number'>bus_number</span><span class='op'>=</span><span class='int'>1</span><span class='rparen'>)</span>
|
|
418
421
|
<span class='ivar'>@sensor_name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>BH1750</span><span class='tstring_end'>'</span></span>
|
|
419
|
-
<span class='
|
|
422
|
+
<span class='const'><span class='object_link'><a href="Bus.html" title="Bus (module)">Bus</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Bus/I2C.html" title="Bus::I2C (class)">I2C</a></span></span><span class='period'>.</span><span class='id identifier rubyid_bus_number'><span class='object_link'><a href="Bus/I2C.html#bus_number-class_method" title="Bus::I2C.bus_number (method)">bus_number</a></span></span> <span class='op'>=</span> <span class='id identifier rubyid_bus_number'>bus_number</span>
|
|
423
|
+
<span class='ivar'>@device_address</span> <span class='op'>=</span> <span class='id identifier rubyid_device_address'>device_address</span>
|
|
424
|
+
|
|
425
|
+
<span class='ivar'>@i2c_bus</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Bus.html" title="Bus (module)">Bus</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Bus/I2C.html" title="Bus::I2C (class)">I2C</a></span></span><span class='period'>.</span><span class='id identifier rubyid_bus'><span class='object_link'><a href="Bus/I2C.html#bus-class_method" title="Bus::I2C.bus (method)">bus</a></span></span>
|
|
420
426
|
<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="BH1750::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>
|
|
421
427
|
<span class='ivar'>@resolution</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="#ONE_TIME_HIGH_RES_MODE_1-constant" title="BH1750::ONE_TIME_HIGH_RES_MODE_1 (constant)">ONE_TIME_HIGH_RES_MODE_1</a></span></span>
|
|
422
428
|
<span class='ivar'>@length</span> <span class='op'>=</span> <span class='int'>2</span>
|
|
@@ -460,13 +466,13 @@
|
|
|
460
466
|
<pre class="lines">
|
|
461
467
|
|
|
462
468
|
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
469
|
+
36
|
|
470
|
+
37
|
|
471
|
+
38
|
|
472
|
+
39</pre>
|
|
467
473
|
</td>
|
|
468
474
|
<td>
|
|
469
|
-
<pre class="code"><span class="info file"># File 'lib/bh1750.rb', line
|
|
475
|
+
<pre class="code"><span class="info file"># File 'lib/bh1750.rb', line 36</span>
|
|
470
476
|
|
|
471
477
|
<span class='kw'>def</span> <span class='id identifier rubyid_lux'>lux</span>
|
|
472
478
|
<span class='id identifier rubyid_read_sensor'>read_sensor</span>
|
|
@@ -503,13 +509,13 @@
|
|
|
503
509
|
<pre class="lines">
|
|
504
510
|
|
|
505
511
|
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
512
|
+
30
|
|
513
|
+
31
|
|
514
|
+
32
|
|
515
|
+
33</pre>
|
|
510
516
|
</td>
|
|
511
517
|
<td>
|
|
512
|
-
<pre class="code"><span class="info file"># File 'lib/bh1750.rb', line
|
|
518
|
+
<pre class="code"><span class="info file"># File 'lib/bh1750.rb', line 30</span>
|
|
513
519
|
|
|
514
520
|
<span class='kw'>def</span> <span class='id identifier rubyid_read_sensor'>read_sensor</span>
|
|
515
521
|
<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='ivar'>@resolution</span><span class='comma'>,</span> <span class='ivar'>@length</span><span class='rparen'>)</span>
|
|
@@ -525,7 +531,7 @@
|
|
|
525
531
|
</div>
|
|
526
532
|
|
|
527
533
|
<div id="footer">
|
|
528
|
-
Generated on
|
|
534
|
+
Generated on Wed Dec 26 18:10:01 2018 by
|
|
529
535
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
530
536
|
0.9.16 (ruby-2.3.3).
|
|
531
537
|
</div>
|
data/doc/BME280.html
CHANGED
|
@@ -245,12 +245,12 @@
|
|
|
245
245
|
<pre class="lines">
|
|
246
246
|
|
|
247
247
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
248
|
+
82
|
|
249
|
+
83
|
|
250
|
+
84</pre>
|
|
251
251
|
</td>
|
|
252
252
|
<td>
|
|
253
|
-
<pre class="code"><span class="info file"># File 'lib/bmx_sensor.rb', line
|
|
253
|
+
<pre class="code"><span class="info file"># File 'lib/bmx_sensor.rb', line 82</span>
|
|
254
254
|
|
|
255
255
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
|
256
256
|
<span class='kw'>super</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>BME280</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|
@@ -266,7 +266,7 @@
|
|
|
266
266
|
</div>
|
|
267
267
|
|
|
268
268
|
<div id="footer">
|
|
269
|
-
Generated on
|
|
269
|
+
Generated on Wed Dec 26 18:10:05 2018 by
|
|
270
270
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
271
271
|
0.9.16 (ruby-2.3.3).
|
|
272
272
|
</div>
|
data/doc/BMP280.html
CHANGED
|
@@ -245,12 +245,12 @@
|
|
|
245
245
|
<pre class="lines">
|
|
246
246
|
|
|
247
247
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
248
|
+
76
|
|
249
|
+
77
|
|
250
|
+
78</pre>
|
|
251
251
|
</td>
|
|
252
252
|
<td>
|
|
253
|
-
<pre class="code"><span class="info file"># File 'lib/bmx_sensor.rb', line
|
|
253
|
+
<pre class="code"><span class="info file"># File 'lib/bmx_sensor.rb', line 76</span>
|
|
254
254
|
|
|
255
255
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
|
256
256
|
<span class='kw'>super</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>BMP280</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
|
@@ -266,7 +266,7 @@
|
|
|
266
266
|
</div>
|
|
267
267
|
|
|
268
268
|
<div id="footer">
|
|
269
|
-
Generated on
|
|
269
|
+
Generated on Wed Dec 26 18:10:04 2018 by
|
|
270
270
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
271
271
|
0.9.16 (ruby-2.3.3).
|
|
272
272
|
</div>
|
data/doc/BMxSensor.html
CHANGED
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
<li class="public ">
|
|
168
168
|
<span class="summary_signature">
|
|
169
169
|
|
|
170
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(sensor_name) ⇒ BMxSensor </a>
|
|
170
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(sensor_name, bus = 1) ⇒ BMxSensor </a>
|
|
171
171
|
|
|
172
172
|
|
|
173
173
|
|
|
@@ -315,7 +315,7 @@
|
|
|
315
315
|
<div class="method_details first">
|
|
316
316
|
<h3 class="signature first" id="initialize-instance_method">
|
|
317
317
|
|
|
318
|
-
#<strong>initialize</strong>(sensor_name) ⇒ <tt><span class='object_link'><a href="" title="BMxSensor (class)">BMxSensor</a></span></tt>
|
|
318
|
+
#<strong>initialize</strong>(sensor_name, bus = 1) ⇒ <tt><span class='object_link'><a href="" title="BMxSensor (class)">BMxSensor</a></span></tt>
|
|
319
319
|
|
|
320
320
|
|
|
321
321
|
|
|
@@ -338,20 +338,18 @@
|
|
|
338
338
|
<pre class="lines">
|
|
339
339
|
|
|
340
340
|
|
|
341
|
-
8
|
|
342
|
-
9
|
|
343
341
|
10
|
|
344
342
|
11
|
|
345
343
|
12
|
|
346
|
-
13
|
|
344
|
+
13
|
|
345
|
+
14</pre>
|
|
347
346
|
</td>
|
|
348
347
|
<td>
|
|
349
|
-
<pre class="code"><span class="info file"># File 'lib/bmx_sensor.rb', line
|
|
348
|
+
<pre class="code"><span class="info file"># File 'lib/bmx_sensor.rb', line 10</span>
|
|
350
349
|
|
|
351
|
-
<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='rparen'>)</span>
|
|
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>
|
|
352
351
|
<span class='ivar'>@sensor_name</span> <span class='op'>=</span> <span class='id identifier rubyid_sensor_name'>sensor_name</span>
|
|
353
|
-
|
|
354
|
-
<span class='ivar'>@sensor</span> <span class='op'>=</span> <span class='const'>I2CDevice</span><span class='op'>::</span><span class='const'>Bme280</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</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>
|
|
355
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>
|
|
356
354
|
<span class='kw'>end</span></pre>
|
|
357
355
|
</td>
|
|
@@ -393,12 +391,12 @@
|
|
|
393
391
|
<pre class="lines">
|
|
394
392
|
|
|
395
393
|
|
|
396
|
-
24
|
|
397
394
|
25
|
|
398
|
-
26
|
|
395
|
+
26
|
|
396
|
+
27</pre>
|
|
399
397
|
</td>
|
|
400
398
|
<td>
|
|
401
|
-
<pre class="code"><span class="info file"># File 'lib/bmx_sensor.rb', line
|
|
399
|
+
<pre class="code"><span class="info file"># File 'lib/bmx_sensor.rb', line 25</span>
|
|
402
400
|
|
|
403
401
|
<span class='kw'>def</span> <span class='id identifier rubyid_hPa'>hPa</span>
|
|
404
402
|
<span class='ivar'>@pressure</span>
|
|
@@ -423,7 +421,6 @@
|
|
|
423
421
|
<pre class="lines">
|
|
424
422
|
|
|
425
423
|
|
|
426
|
-
28
|
|
427
424
|
29
|
|
428
425
|
30
|
|
429
426
|
31
|
|
@@ -444,10 +441,11 @@
|
|
|
444
441
|
46
|
|
445
442
|
47
|
|
446
443
|
48
|
|
447
|
-
49
|
|
444
|
+
49
|
|
445
|
+
50</pre>
|
|
448
446
|
</td>
|
|
449
447
|
<td>
|
|
450
|
-
<pre class="code"><span class="info file"># File 'lib/bmx_sensor.rb', line
|
|
448
|
+
<pre class="code"><span class="info file"># File 'lib/bmx_sensor.rb', line 29</span>
|
|
451
449
|
|
|
452
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>
|
|
453
451
|
<span class='kw'>case</span> <span class='id identifier rubyid_mode'>mode</span>
|
|
@@ -491,22 +489,22 @@
|
|
|
491
489
|
<pre class="lines">
|
|
492
490
|
|
|
493
491
|
|
|
494
|
-
15
|
|
495
492
|
16
|
|
496
493
|
17
|
|
497
494
|
18
|
|
498
495
|
19
|
|
499
496
|
20
|
|
500
|
-
21
|
|
497
|
+
21
|
|
498
|
+
22</pre>
|
|
501
499
|
</td>
|
|
502
500
|
<td>
|
|
503
|
-
<pre class="code"><span class="info file"># File 'lib/bmx_sensor.rb', line
|
|
501
|
+
<pre class="code"><span class="info file"># File 'lib/bmx_sensor.rb', line 16</span>
|
|
504
502
|
|
|
505
503
|
<span class='kw'>def</span> <span class='id identifier rubyid_read_data'>read_data</span>
|
|
506
|
-
<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
|
|
507
|
-
<span class='ivar'>@temperature</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='symbol'>:
|
|
508
|
-
<span class='ivar'>@pressure</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='symbol'>:
|
|
509
|
-
<span class='ivar'>@humidity</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='symbol'>:
|
|
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>
|
|
510
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>
|
|
511
509
|
<span class='kw'>end</span></pre>
|
|
512
510
|
</td>
|
|
@@ -529,12 +527,12 @@
|
|
|
529
527
|
<pre class="lines">
|
|
530
528
|
|
|
531
529
|
|
|
532
|
-
51
|
|
533
530
|
52
|
|
534
|
-
53
|
|
531
|
+
53
|
|
532
|
+
54</pre>
|
|
535
533
|
</td>
|
|
536
534
|
<td>
|
|
537
|
-
<pre class="code"><span class="info file"># File 'lib/bmx_sensor.rb', line
|
|
535
|
+
<pre class="code"><span class="info file"># File 'lib/bmx_sensor.rb', line 52</span>
|
|
538
536
|
|
|
539
537
|
<span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span>
|
|
540
538
|
<span class='id identifier rubyid_sprintf'>sprintf</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>%5.2f°C, %5.2f %%, %5.2f mmHg</span><span class='tstring_end'>"</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>
|
|
@@ -549,7 +547,7 @@
|
|
|
549
547
|
</div>
|
|
550
548
|
|
|
551
549
|
<div id="footer">
|
|
552
|
-
Generated on
|
|
550
|
+
Generated on Wed Dec 26 18:10:03 2018 by
|
|
553
551
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
554
552
|
0.9.16 (ruby-2.3.3).
|
|
555
553
|
</div>
|
data/doc/BinaryActuator.html
CHANGED
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
|
|
101
101
|
<dl>
|
|
102
102
|
<dt>Defined in:</dt>
|
|
103
|
-
<dd>lib/
|
|
103
|
+
<dd>lib/binary_actuator.rb</dd>
|
|
104
104
|
</dl>
|
|
105
105
|
|
|
106
106
|
</div>
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
<h2>Overview</h2><div class="docstring">
|
|
109
109
|
<div class="discussion">
|
|
110
110
|
|
|
111
|
-
<p>BinaryActuator - synomym for BinaryEffector</p>
|
|
111
|
+
<p>BinaryActuator - a synomym for BinaryEffector</p>
|
|
112
112
|
|
|
113
113
|
|
|
114
114
|
</div>
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
</div>
|
|
168
168
|
|
|
169
169
|
<div id="footer">
|
|
170
|
-
Generated on
|
|
170
|
+
Generated on Wed Dec 26 18:10:01 2018 by
|
|
171
171
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
172
172
|
0.9.16 (ruby-2.3.3).
|
|
173
173
|
</div>
|
data/doc/BinaryEffector.html
CHANGED
|
@@ -236,7 +236,7 @@
|
|
|
236
236
|
</div>
|
|
237
237
|
|
|
238
238
|
<div id="footer">
|
|
239
|
-
Generated on
|
|
239
|
+
Generated on Wed Dec 26 18:10:02 2018 by
|
|
240
240
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
241
241
|
0.9.16 (ruby-2.3.3).
|
|
242
242
|
</div>
|
data/doc/BinaryReceptor.html
CHANGED
|
@@ -377,7 +377,7 @@
|
|
|
377
377
|
</div>
|
|
378
378
|
|
|
379
379
|
<div id="footer">
|
|
380
|
-
Generated on
|
|
380
|
+
Generated on Wed Dec 26 18:10:02 2018 by
|
|
381
381
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
382
382
|
0.9.16 (ruby-2.3.3).
|
|
383
383
|
</div>
|
data/doc/BinarySensor.html
CHANGED
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
|
|
99
99
|
<dl>
|
|
100
100
|
<dt>Defined in:</dt>
|
|
101
|
-
<dd>lib/
|
|
101
|
+
<dd>lib/binary_sensor.rb</dd>
|
|
102
102
|
</dl>
|
|
103
103
|
|
|
104
104
|
</div>
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
</div>
|
|
159
159
|
|
|
160
160
|
<div id="footer">
|
|
161
|
-
Generated on
|
|
161
|
+
Generated on Wed Dec 26 18:10:02 2018 by
|
|
162
162
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
163
163
|
0.9.16 (ruby-2.3.3).
|
|
164
164
|
</div>
|
data/doc/Bus.html
CHANGED
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
</div>
|
|
117
117
|
|
|
118
118
|
<div id="footer">
|
|
119
|
-
Generated on
|
|
119
|
+
Generated on Wed Dec 26 18:10:00 2018 by
|
|
120
120
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
121
121
|
0.9.16 (ruby-2.3.3).
|
|
122
122
|
</div>
|
data/doc/Button.html
CHANGED
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
<h2>Overview</h2><div class="docstring">
|
|
107
107
|
<div class="discussion">
|
|
108
108
|
|
|
109
|
-
<p>Button - simple push button</p>
|
|
109
|
+
<p>Button - simple tactile / push button</p>
|
|
110
110
|
|
|
111
111
|
|
|
112
112
|
</div>
|
|
@@ -255,7 +255,7 @@
|
|
|
255
255
|
|
|
256
256
|
|
|
257
257
|
<span class="summary_desc"><div class='inline'>
|
|
258
|
-
<p>Is button not pressed?.</p>
|
|
258
|
+
<p>Is button not being pressed?.</p>
|
|
259
259
|
</div></span>
|
|
260
260
|
|
|
261
261
|
</li>
|
|
@@ -279,9 +279,31 @@
|
|
|
279
279
|
|
|
280
280
|
|
|
281
281
|
<span class="summary_desc"><div class='inline'>
|
|
282
|
-
<p>Is button pressed?.</p>
|
|
282
|
+
<p>Is button being pressed?.</p>
|
|
283
283
|
</div></span>
|
|
284
284
|
|
|
285
|
+
</li>
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
<li class="public ">
|
|
289
|
+
<span class="summary_signature">
|
|
290
|
+
|
|
291
|
+
<a href="#set_timeout-instance_method" title="#set_timeout (instance method)">#<strong>set_timeout</strong>(timeout) ⇒ Object </a>
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
</span>
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
306
|
+
|
|
285
307
|
</li>
|
|
286
308
|
|
|
287
309
|
|
|
@@ -306,6 +328,28 @@
|
|
|
306
328
|
<p>Was the button pressed once?.</p>
|
|
307
329
|
</div></span>
|
|
308
330
|
|
|
331
|
+
</li>
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
<li class="public ">
|
|
335
|
+
<span class="summary_signature">
|
|
336
|
+
|
|
337
|
+
<a href="#timeout%3F-instance_method" title="#timeout? (instance method)">#<strong>timeout?</strong> ⇒ Boolean </a>
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
</span>
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
352
|
+
|
|
309
353
|
</li>
|
|
310
354
|
|
|
311
355
|
|
|
@@ -360,7 +404,7 @@
|
|
|
360
404
|
<li class="public ">
|
|
361
405
|
<span class="summary_signature">
|
|
362
406
|
|
|
363
|
-
<a href="#wait_for_presses-instance_method" title="#wait_for_presses (instance method)">#<strong>wait_for_presses</strong>(attempts = 2) ⇒ Object </a>
|
|
407
|
+
<a href="#wait_for_presses-instance_method" title="#wait_for_presses (instance method)">#<strong>wait_for_presses</strong>(attempts = 2, timeout = @timeout) ⇒ Object </a>
|
|
364
408
|
|
|
365
409
|
|
|
366
410
|
|
|
@@ -378,6 +422,50 @@
|
|
|
378
422
|
<p>Wait for several sequential presses.</p>
|
|
379
423
|
</div></span>
|
|
380
424
|
|
|
425
|
+
</li>
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
<li class="public ">
|
|
429
|
+
<span class="summary_signature">
|
|
430
|
+
|
|
431
|
+
<a href="#was_not_pressed%3F-instance_method" title="#was_not_pressed? (instance method)">#<strong>was_not_pressed?</strong> ⇒ Boolean </a>
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
</span>
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
446
|
+
|
|
447
|
+
</li>
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
<li class="public ">
|
|
451
|
+
<span class="summary_signature">
|
|
452
|
+
|
|
453
|
+
<a href="#was_pressed%3F-instance_method" title="#was_pressed? (instance method)">#<strong>was_pressed?</strong> ⇒ Boolean </a>
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
</span>
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
468
|
+
|
|
381
469
|
</li>
|
|
382
470
|
|
|
383
471
|
|
|
@@ -442,7 +530,11 @@
|
|
|
442
530
|
11
|
|
443
531
|
12
|
|
444
532
|
13
|
|
445
|
-
14
|
|
533
|
+
14
|
|
534
|
+
15
|
|
535
|
+
16
|
|
536
|
+
17
|
|
537
|
+
18</pre>
|
|
446
538
|
</td>
|
|
447
539
|
<td>
|
|
448
540
|
<pre class="code"><span class="info file"># File 'lib/button.rb', line 7</span>
|
|
@@ -453,8 +545,12 @@
|
|
|
453
545
|
<span class='ivar'>@measure_pause</span> <span class='op'>=</span> <span class='float'>0.01</span>
|
|
454
546
|
<span class='ivar'>@long_click</span> <span class='op'>=</span> <span class='float'>1.0</span>
|
|
455
547
|
<span class='ivar'>@short_interval</span> <span class='op'>=</span> <span class='float'>0.2</span>
|
|
548
|
+
<span class='ivar'>@timeout</span> <span class='op'>=</span> <span class='int'>30</span>
|
|
456
549
|
<span class='ivar'>@intervals</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
|
457
|
-
<span class='
|
|
550
|
+
<span class='comment'># samples: wait time press time wait time press time
|
|
551
|
+
</span> <span class='comment'># double press: [[1.486804292, 0.090814152], [0.131284967, 0.13125429]]
|
|
552
|
+
</span> <span class='comment'># long press: [[0.910878286, 1.109352219]]
|
|
553
|
+
</span><span class='kw'>end</span></pre>
|
|
458
554
|
</td>
|
|
459
555
|
</tr>
|
|
460
556
|
</table>
|
|
@@ -574,12 +670,12 @@
|
|
|
574
670
|
<pre class="lines">
|
|
575
671
|
|
|
576
672
|
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
673
|
+
69
|
|
674
|
+
70
|
|
675
|
+
71</pre>
|
|
580
676
|
</td>
|
|
581
677
|
<td>
|
|
582
|
-
<pre class="code"><span class="info file"># File 'lib/button.rb', line
|
|
678
|
+
<pre class="code"><span class="info file"># File 'lib/button.rb', line 69</span>
|
|
583
679
|
|
|
584
680
|
<span class='kw'>def</span> <span class='id identifier rubyid_double_press?'>double_press?</span><span class='lparen'>(</span><span class='id identifier rubyid_intervals'>intervals</span><span class='op'>=</span><span class='ivar'>@intervals</span><span class='rparen'>)</span>
|
|
585
681
|
<span class='id identifier rubyid_intervals'>intervals</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>==</span> <span class='int'>2</span> <span class='op'>&&</span> <span class='id identifier rubyid_intervals'>intervals</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='op'><=</span> <span class='ivar'>@short_interval</span>
|
|
@@ -628,12 +724,12 @@
|
|
|
628
724
|
<pre class="lines">
|
|
629
725
|
|
|
630
726
|
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
727
|
+
79
|
|
728
|
+
80
|
|
729
|
+
81</pre>
|
|
634
730
|
</td>
|
|
635
731
|
<td>
|
|
636
|
-
<pre class="code"><span class="info file"># File 'lib/button.rb', line
|
|
732
|
+
<pre class="code"><span class="info file"># File 'lib/button.rb', line 79</span>
|
|
637
733
|
|
|
638
734
|
<span class='kw'>def</span> <span class='id identifier rubyid_long_press?'>long_press?</span><span class='lparen'>(</span><span class='id identifier rubyid_intervals'>intervals</span><span class='op'>=</span><span class='ivar'>@intervals</span><span class='rparen'>)</span>
|
|
639
735
|
<span class='id identifier rubyid_intervals'>intervals</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>==</span> <span class='int'>1</span> <span class='op'>&&</span> <span class='id identifier rubyid_intervals'>intervals</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>>=</span> <span class='ivar'>@long_click</span>
|
|
@@ -655,7 +751,7 @@
|
|
|
655
751
|
</h3><div class="docstring">
|
|
656
752
|
<div class="discussion">
|
|
657
753
|
|
|
658
|
-
<p>Is button not pressed?</p>
|
|
754
|
+
<p>Is button not being pressed?</p>
|
|
659
755
|
|
|
660
756
|
|
|
661
757
|
</div>
|
|
@@ -682,12 +778,12 @@
|
|
|
682
778
|
<pre class="lines">
|
|
683
779
|
|
|
684
780
|
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
781
|
+
26
|
|
782
|
+
27
|
|
783
|
+
28</pre>
|
|
688
784
|
</td>
|
|
689
785
|
<td>
|
|
690
|
-
<pre class="code"><span class="info file"># File 'lib/button.rb', line
|
|
786
|
+
<pre class="code"><span class="info file"># File 'lib/button.rb', line 26</span>
|
|
691
787
|
|
|
692
788
|
<span class='kw'>def</span> <span class='id identifier rubyid_not_pressed?'>not_pressed?</span>
|
|
693
789
|
<span class='id identifier rubyid_high?'>high?</span>
|
|
@@ -709,7 +805,7 @@
|
|
|
709
805
|
</h3><div class="docstring">
|
|
710
806
|
<div class="discussion">
|
|
711
807
|
|
|
712
|
-
<p>Is button pressed?</p>
|
|
808
|
+
<p>Is button being pressed?</p>
|
|
713
809
|
|
|
714
810
|
|
|
715
811
|
</div>
|
|
@@ -736,12 +832,12 @@
|
|
|
736
832
|
<pre class="lines">
|
|
737
833
|
|
|
738
834
|
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
835
|
+
21
|
|
836
|
+
22
|
|
837
|
+
23</pre>
|
|
742
838
|
</td>
|
|
743
839
|
<td>
|
|
744
|
-
<pre class="code"><span class="info file"># File 'lib/button.rb', line
|
|
840
|
+
<pre class="code"><span class="info file"># File 'lib/button.rb', line 21</span>
|
|
745
841
|
|
|
746
842
|
<span class='kw'>def</span> <span class='id identifier rubyid_pressed?'>pressed?</span>
|
|
747
843
|
<span class='id identifier rubyid_low?'>low?</span>
|
|
@@ -749,6 +845,36 @@
|
|
|
749
845
|
</td>
|
|
750
846
|
</tr>
|
|
751
847
|
</table>
|
|
848
|
+
</div>
|
|
849
|
+
|
|
850
|
+
<div class="method_details ">
|
|
851
|
+
<h3 class="signature " id="set_timeout-instance_method">
|
|
852
|
+
|
|
853
|
+
#<strong>set_timeout</strong>(timeout) ⇒ <tt>Object</tt>
|
|
854
|
+
|
|
855
|
+
|
|
856
|
+
|
|
857
|
+
|
|
858
|
+
|
|
859
|
+
</h3><table class="source_code">
|
|
860
|
+
<tr>
|
|
861
|
+
<td>
|
|
862
|
+
<pre class="lines">
|
|
863
|
+
|
|
864
|
+
|
|
865
|
+
83
|
|
866
|
+
84
|
|
867
|
+
85</pre>
|
|
868
|
+
</td>
|
|
869
|
+
<td>
|
|
870
|
+
<pre class="code"><span class="info file"># File 'lib/button.rb', line 83</span>
|
|
871
|
+
|
|
872
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_set_timeout'>set_timeout</span><span class='lparen'>(</span><span class='id identifier rubyid_timeout'>timeout</span><span class='rparen'>)</span>
|
|
873
|
+
<span class='ivar'>@timeout</span> <span class='op'>=</span> <span class='id identifier rubyid_timeout'>timeout</span>
|
|
874
|
+
<span class='kw'>end</span></pre>
|
|
875
|
+
</td>
|
|
876
|
+
</tr>
|
|
877
|
+
</table>
|
|
752
878
|
</div>
|
|
753
879
|
|
|
754
880
|
<div class="method_details ">
|
|
@@ -790,12 +916,12 @@
|
|
|
790
916
|
<pre class="lines">
|
|
791
917
|
|
|
792
918
|
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
919
|
+
64
|
|
920
|
+
65
|
|
921
|
+
66</pre>
|
|
796
922
|
</td>
|
|
797
923
|
<td>
|
|
798
|
-
<pre class="code"><span class="info file"># File 'lib/button.rb', line
|
|
924
|
+
<pre class="code"><span class="info file"># File 'lib/button.rb', line 64</span>
|
|
799
925
|
|
|
800
926
|
<span class='kw'>def</span> <span class='id identifier rubyid_single_press?'>single_press?</span><span class='lparen'>(</span><span class='id identifier rubyid_intervals'>intervals</span><span class='op'>=</span><span class='ivar'>@intervals</span><span class='rparen'>)</span>
|
|
801
927
|
<span class='id identifier rubyid_intervals'>intervals</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>==</span> <span class='int'>1</span>
|
|
@@ -803,6 +929,66 @@
|
|
|
803
929
|
</td>
|
|
804
930
|
</tr>
|
|
805
931
|
</table>
|
|
932
|
+
</div>
|
|
933
|
+
|
|
934
|
+
<div class="method_details ">
|
|
935
|
+
<h3 class="signature " id="timeout?-instance_method">
|
|
936
|
+
|
|
937
|
+
#<strong>timeout?</strong> ⇒ <tt>Boolean</tt>
|
|
938
|
+
|
|
939
|
+
|
|
940
|
+
|
|
941
|
+
|
|
942
|
+
|
|
943
|
+
</h3><div class="docstring">
|
|
944
|
+
<div class="discussion">
|
|
945
|
+
|
|
946
|
+
|
|
947
|
+
</div>
|
|
948
|
+
</div>
|
|
949
|
+
<div class="tags">
|
|
950
|
+
|
|
951
|
+
<p class="tag_title">Returns:</p>
|
|
952
|
+
<ul class="return">
|
|
953
|
+
|
|
954
|
+
<li>
|
|
955
|
+
|
|
956
|
+
|
|
957
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
|
958
|
+
|
|
959
|
+
|
|
960
|
+
|
|
961
|
+
</li>
|
|
962
|
+
|
|
963
|
+
</ul>
|
|
964
|
+
|
|
965
|
+
</div><table class="source_code">
|
|
966
|
+
<tr>
|
|
967
|
+
<td>
|
|
968
|
+
<pre class="lines">
|
|
969
|
+
|
|
970
|
+
|
|
971
|
+
87
|
|
972
|
+
88
|
|
973
|
+
89
|
|
974
|
+
90
|
|
975
|
+
91
|
|
976
|
+
92
|
|
977
|
+
93</pre>
|
|
978
|
+
</td>
|
|
979
|
+
<td>
|
|
980
|
+
<pre class="code"><span class="info file"># File 'lib/button.rb', line 87</span>
|
|
981
|
+
|
|
982
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_timeout?'>timeout?</span>
|
|
983
|
+
<span class='id identifier rubyid_min_wait_time'>min_wait_time</span> <span class='op'>=</span> <span class='float'>0.0</span>
|
|
984
|
+
<span class='ivar'>@intervals</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_interval'>interval</span><span class='op'>|</span>
|
|
985
|
+
<span class='id identifier rubyid_min_wait_time'>min_wait_time</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_min_wait_time'>min_wait_time</span><span class='comma'>,</span> <span class='id identifier rubyid_interval'>interval</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_min'>min</span>
|
|
986
|
+
<span class='kw'>end</span>
|
|
987
|
+
<span class='id identifier rubyid_min_wait_time'>min_wait_time</span> <span class='op'>></span> <span class='ivar'>@timeout</span>
|
|
988
|
+
<span class='kw'>end</span></pre>
|
|
989
|
+
</td>
|
|
990
|
+
</tr>
|
|
991
|
+
</table>
|
|
806
992
|
</div>
|
|
807
993
|
|
|
808
994
|
<div class="method_details ">
|
|
@@ -844,12 +1030,12 @@
|
|
|
844
1030
|
<pre class="lines">
|
|
845
1031
|
|
|
846
1032
|
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
1033
|
+
74
|
|
1034
|
+
75
|
|
1035
|
+
76</pre>
|
|
850
1036
|
</td>
|
|
851
1037
|
<td>
|
|
852
|
-
<pre class="code"><span class="info file"># File 'lib/button.rb', line
|
|
1038
|
+
<pre class="code"><span class="info file"># File 'lib/button.rb', line 74</span>
|
|
853
1039
|
|
|
854
1040
|
<span class='kw'>def</span> <span class='id identifier rubyid_triple_press?'>triple_press?</span><span class='lparen'>(</span><span class='id identifier rubyid_intervals'>intervals</span><span class='op'>=</span><span class='ivar'>@intervals</span><span class='rparen'>)</span>
|
|
855
1041
|
<span class='id identifier rubyid_intervals'>intervals</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>==</span> <span class='int'>3</span>
|
|
@@ -885,12 +1071,12 @@
|
|
|
885
1071
|
<pre class="lines">
|
|
886
1072
|
|
|
887
1073
|
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
1074
|
+
39
|
|
1075
|
+
40
|
|
1076
|
+
41</pre>
|
|
891
1077
|
</td>
|
|
892
1078
|
<td>
|
|
893
|
-
<pre class="code"><span class="info file"># File 'lib/button.rb', line
|
|
1079
|
+
<pre class="code"><span class="info file"># File 'lib/button.rb', line 39</span>
|
|
894
1080
|
|
|
895
1081
|
<span class='kw'>def</span> <span class='id identifier rubyid_wait_for_press'>wait_for_press</span>
|
|
896
1082
|
<span class='id identifier rubyid_wait_for_presses'>wait_for_presses</span><span class='lparen'>(</span><span class='int'>1</span><span class='rparen'>)</span>
|
|
@@ -903,7 +1089,7 @@
|
|
|
903
1089
|
<div class="method_details ">
|
|
904
1090
|
<h3 class="signature " id="wait_for_presses-instance_method">
|
|
905
1091
|
|
|
906
|
-
#<strong>wait_for_presses</strong>(attempts = 2) ⇒ <tt>Object</tt>
|
|
1092
|
+
#<strong>wait_for_presses</strong>(attempts = 2, timeout = @timeout) ⇒ <tt>Object</tt>
|
|
907
1093
|
|
|
908
1094
|
|
|
909
1095
|
|
|
@@ -926,34 +1112,34 @@
|
|
|
926
1112
|
<pre class="lines">
|
|
927
1113
|
|
|
928
1114
|
|
|
929
|
-
32
|
|
930
|
-
33
|
|
931
|
-
34
|
|
932
|
-
35
|
|
933
|
-
36
|
|
934
|
-
37
|
|
935
|
-
38
|
|
936
|
-
39
|
|
937
|
-
40
|
|
938
|
-
41
|
|
939
|
-
42
|
|
940
|
-
43
|
|
941
1115
|
44
|
|
942
1116
|
45
|
|
943
1117
|
46
|
|
944
1118
|
47
|
|
945
1119
|
48
|
|
946
|
-
49
|
|
1120
|
+
49
|
|
1121
|
+
50
|
|
1122
|
+
51
|
|
1123
|
+
52
|
|
1124
|
+
53
|
|
1125
|
+
54
|
|
1126
|
+
55
|
|
1127
|
+
56
|
|
1128
|
+
57
|
|
1129
|
+
58
|
|
1130
|
+
59
|
|
1131
|
+
60
|
|
1132
|
+
61</pre>
|
|
947
1133
|
</td>
|
|
948
1134
|
<td>
|
|
949
|
-
<pre class="code"><span class="info file"># File 'lib/button.rb', line
|
|
1135
|
+
<pre class="code"><span class="info file"># File 'lib/button.rb', line 44</span>
|
|
950
1136
|
|
|
951
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_wait_for_presses'>wait_for_presses</span><span class='lparen'>(</span><span class='id identifier rubyid_attempts'>attempts</span><span class='op'>=</span><span class='int'>2</span><span class='rparen'>)</span>
|
|
1137
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_wait_for_presses'>wait_for_presses</span><span class='lparen'>(</span><span class='id identifier rubyid_attempts'>attempts</span><span class='op'>=</span><span class='int'>2</span><span class='comma'>,</span> <span class='id identifier rubyid_timeout'>timeout</span><span class='op'>=</span><span class='ivar'>@timeout</span><span class='rparen'>)</span>
|
|
952
1138
|
<span class='ivar'>@intervals</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
|
953
1139
|
<span class='id identifier rubyid_attempts'>attempts</span><span class='period'>.</span><span class='id identifier rubyid_times'>times</span> <span class='kw'>do</span>
|
|
954
1140
|
<span class='id identifier rubyid_interval'>interval</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
|
955
1141
|
<span class='id identifier rubyid_timer'>timer</span> <span class='op'>=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span>
|
|
956
|
-
<span class='kw'>while</span> <span class='id identifier rubyid_not_pressed?'>not_pressed?</span> <span class='kw'>do</span>
|
|
1142
|
+
<span class='kw'>while</span> <span class='id identifier rubyid_not_pressed?'>not_pressed?</span> <span class='op'>&&</span> <span class='lparen'>(</span><span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span><span class='op'>-</span><span class='id identifier rubyid_timer'>timer</span><span class='rparen'>)</span> <span class='op'><</span> <span class='id identifier rubyid_timeout'>timeout</span> <span class='kw'>do</span>
|
|
957
1143
|
<span class='id identifier rubyid_sleep'>sleep</span> <span class='ivar'>@measure_pause</span>
|
|
958
1144
|
<span class='kw'>end</span>
|
|
959
1145
|
<span class='id identifier rubyid_interval'>interval</span> <span class='op'><<</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span><span class='op'>-</span><span class='id identifier rubyid_timer'>timer</span>
|
|
@@ -969,6 +1155,110 @@
|
|
|
969
1155
|
</td>
|
|
970
1156
|
</tr>
|
|
971
1157
|
</table>
|
|
1158
|
+
</div>
|
|
1159
|
+
|
|
1160
|
+
<div class="method_details ">
|
|
1161
|
+
<h3 class="signature " id="was_not_pressed?-instance_method">
|
|
1162
|
+
|
|
1163
|
+
#<strong>was_not_pressed?</strong> ⇒ <tt>Boolean</tt>
|
|
1164
|
+
|
|
1165
|
+
|
|
1166
|
+
|
|
1167
|
+
|
|
1168
|
+
|
|
1169
|
+
</h3><div class="docstring">
|
|
1170
|
+
<div class="discussion">
|
|
1171
|
+
|
|
1172
|
+
|
|
1173
|
+
</div>
|
|
1174
|
+
</div>
|
|
1175
|
+
<div class="tags">
|
|
1176
|
+
|
|
1177
|
+
<p class="tag_title">Returns:</p>
|
|
1178
|
+
<ul class="return">
|
|
1179
|
+
|
|
1180
|
+
<li>
|
|
1181
|
+
|
|
1182
|
+
|
|
1183
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
|
1184
|
+
|
|
1185
|
+
|
|
1186
|
+
|
|
1187
|
+
</li>
|
|
1188
|
+
|
|
1189
|
+
</ul>
|
|
1190
|
+
|
|
1191
|
+
</div><table class="source_code">
|
|
1192
|
+
<tr>
|
|
1193
|
+
<td>
|
|
1194
|
+
<pre class="lines">
|
|
1195
|
+
|
|
1196
|
+
|
|
1197
|
+
34
|
|
1198
|
+
35
|
|
1199
|
+
36</pre>
|
|
1200
|
+
</td>
|
|
1201
|
+
<td>
|
|
1202
|
+
<pre class="code"><span class="info file"># File 'lib/button.rb', line 34</span>
|
|
1203
|
+
|
|
1204
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_was_not_pressed?'>was_not_pressed?</span>
|
|
1205
|
+
<span class='op'>!</span><span class='id identifier rubyid_was_pressed?'>was_pressed?</span>
|
|
1206
|
+
<span class='kw'>end</span></pre>
|
|
1207
|
+
</td>
|
|
1208
|
+
</tr>
|
|
1209
|
+
</table>
|
|
1210
|
+
</div>
|
|
1211
|
+
|
|
1212
|
+
<div class="method_details ">
|
|
1213
|
+
<h3 class="signature " id="was_pressed?-instance_method">
|
|
1214
|
+
|
|
1215
|
+
#<strong>was_pressed?</strong> ⇒ <tt>Boolean</tt>
|
|
1216
|
+
|
|
1217
|
+
|
|
1218
|
+
|
|
1219
|
+
|
|
1220
|
+
|
|
1221
|
+
</h3><div class="docstring">
|
|
1222
|
+
<div class="discussion">
|
|
1223
|
+
|
|
1224
|
+
|
|
1225
|
+
</div>
|
|
1226
|
+
</div>
|
|
1227
|
+
<div class="tags">
|
|
1228
|
+
|
|
1229
|
+
<p class="tag_title">Returns:</p>
|
|
1230
|
+
<ul class="return">
|
|
1231
|
+
|
|
1232
|
+
<li>
|
|
1233
|
+
|
|
1234
|
+
|
|
1235
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
|
1236
|
+
|
|
1237
|
+
|
|
1238
|
+
|
|
1239
|
+
</li>
|
|
1240
|
+
|
|
1241
|
+
</ul>
|
|
1242
|
+
|
|
1243
|
+
</div><table class="source_code">
|
|
1244
|
+
<tr>
|
|
1245
|
+
<td>
|
|
1246
|
+
<pre class="lines">
|
|
1247
|
+
|
|
1248
|
+
|
|
1249
|
+
30
|
|
1250
|
+
31
|
|
1251
|
+
32</pre>
|
|
1252
|
+
</td>
|
|
1253
|
+
<td>
|
|
1254
|
+
<pre class="code"><span class="info file"># File 'lib/button.rb', line 30</span>
|
|
1255
|
+
|
|
1256
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_was_pressed?'>was_pressed?</span>
|
|
1257
|
+
<span class='ivar'>@intervals</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>></span> <span class='int'>0</span>
|
|
1258
|
+
<span class='kw'>end</span></pre>
|
|
1259
|
+
</td>
|
|
1260
|
+
</tr>
|
|
1261
|
+
</table>
|
|
972
1262
|
</div>
|
|
973
1263
|
|
|
974
1264
|
</div>
|
|
@@ -976,7 +1266,7 @@
|
|
|
976
1266
|
</div>
|
|
977
1267
|
|
|
978
1268
|
<div id="footer">
|
|
979
|
-
Generated on
|
|
1269
|
+
Generated on Wed Dec 26 18:10:07 2018 by
|
|
980
1270
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
981
1271
|
0.9.16 (ruby-2.3.3).
|
|
982
1272
|
</div>
|