Commit Graph

88 Commits

Author SHA1 Message Date
Ben Nuttall
cbc2b95494 Fix RST in readme v0.6.0 2015-09-28 12:50:38 +01:00
Ben Nuttall
2aede36365 Add recipes 2015-09-28 12:47:21 +01:00
Ben Nuttall
c1db2dce55 Tidy up docs index 2015-09-28 11:50:56 +01:00
Ben Nuttall
9ca5b60aa8 Ignore built documentation directory 2015-09-28 11:48:53 +01:00
Ben Nuttall
b2a36bba47 Resolve merge conflict 2015-09-28 11:38:09 +01:00
Ben Nuttall
3f960f6da3 Update docstrings and add initial set of documentation 2015-09-28 11:11:00 +01:00
Ben Nuttall
3d6b16e4e4 Merge pull request #35 from waveform80/pull-up-fix
Fix #27
2015-09-27 22:30:21 +01:00
Dave Jones
c35dd1698b Fix #27 2015-09-27 17:29:21 +01:00
Ben Nuttall
a38ab6cd45 Merge pull request #33 from waveform80/blink-fg-bg
Fix #32
2015-09-24 18:49:45 +01:00
Dave Jones
980e4e7144 Fix #32 2015-09-24 16:45:55 +01:00
Ben Nuttall
7811ed67c9 Ensure args are passed to flash() 2015-09-24 12:23:09 +01:00
Ben Nuttall
cfed671972 Add docstrings, close #26 v0.5.0 2015-09-24 11:39:50 +01:00
Ben Nuttall
c619aab630 Expose LEDBoard 2015-09-23 17:47:49 +01:00
Ben Nuttall
d47aff9f69 Make TrafficLights extend LEDBoard 2015-09-23 17:30:17 +01:00
Ben Nuttall
12800db25f Refactor PiLiter into generic LEDBoard class 2015-09-23 16:32:00 +01:00
Ben Nuttall
b97e97909c Add flash method to output devices and boards, close #22 2015-09-23 15:31:06 +01:00
Ben Nuttall
931571b85d Add toggle to boards 2015-09-23 14:44:41 +01:00
Ben Nuttall
3a19d8f5ab Merge branch 'master' of github.com:rpi-distro/python-gpiozero 2015-09-23 14:18:44 +01:00
Ben Nuttall
5e0a56b11c Make buzzer blink, close #19 2015-09-23 14:18:40 +01:00
Ben Nuttall
63a1dc16b1 Merge pull request #31 from waveform80/nice-repr
Fix #25
2015-09-23 14:14:16 +01:00
Dave Jones
6b7a3c8851 Fix #25
Add a nice __repr__ to the GPIODevice base class.

This isn't much but generally I think `__repr__` implementations should
be deliberately simple: firstly, they're frequently used for debugging
so if they're at all complex you risk making a debugging tool buggy
(very annoying!). Secondly, if you pour too much info into them you risk
making the debugging output cluttered, so I tend to prefer keeping it to
straight-forward simple to retrieve/calculate info without excessive
detail (if the user wants more, they can always query it directly).

There is one refinement here: in SmoothedInputDevice, `__repr__` is
tweaked to ensure that when partial is False (the default), and the
queue isn't filled, `__repr__` doesn't block (because it should *never*
block).
2015-09-23 14:07:17 +01:00
Ben Nuttall
d869d1e092 Merge pull request #30 from waveform80/flexible-events-opt-params
Flexible events opt params
2015-09-23 13:50:23 +01:00
Ben Nuttall
25b5756b8c Merge pull request #29 from waveform80/output-toggle
Fix #23
2015-09-23 13:50:01 +01:00
Dave Jones
4e33052703 Fix #28
Re-order the test bindings to prefer using no parameters if possible
2015-09-23 13:47:32 +01:00
Dave Jones
7c647ec616 Fix #23
Add OutputDevice.toggle method with locking for correct threaded
operation
2015-09-23 13:38:37 +01:00
Ben Nuttall
e805eedd13 Add properties for leds and all on boards 2015-09-23 11:42:06 +01:00
Ben Nuttall
4a7d60f6a3 Release v0.4.0 v0.4.0 2015-09-23 11:20:43 +01:00
Ben Nuttall
bb33b9aff3 Fix PiTraffic and TrafficHat 2015-09-23 11:16:42 +01:00
Ben Nuttall
2d999f82ab Merge branch 'master' of github.com:rpi-distro/python-gpiozero 2015-09-23 11:15:17 +01:00
Ben Nuttall
5b846a53ca Merge pull request #24 from waveform80/flexible-events
Flexible events
2015-09-23 11:14:39 +01:00
Dave Jones
5c12d8c2e0 Flexible events
Permit event callbacks to accept no parameters, or a single parameter
providing the source input object
2015-09-22 23:20:29 +01:00
Dave Jones
b81d9ed875 Fix missing comma in __init__ 2015-09-22 22:08:06 +01:00
Ben Nuttall
8fe2a9d8ca Add missing comma 2015-09-22 18:23:56 +01:00
Ben Nuttall
b878905f4d Version bump 2015-09-22 18:07:32 +01:00
Ben Nuttall
65d363b7ed Tidy up 2015-09-22 17:52:19 +01:00
Ben Nuttall
b16127dd39 Add PiTraffic back in (was accidentally deleted in e474215) 2015-09-22 17:18:38 +01:00
Ben Nuttall
1bc5a5fa92 Release v0.3.0 v0.3.0 2015-09-22 16:34:25 +01:00
Ben Nuttall
74045c794a Merge pull request #21 from waveform80/tidy-boards
Minor cleanup in boards
2015-09-22 15:25:47 +01:00
Dave Jones
3df061b1bd Minor cleanup in boards
super calls weren't specified correctly, and there's no need to convert
to lists for adding tuples - tuples add to tuples just fine, just not
lists.
2015-09-22 15:05:11 +01:00
Ben Nuttall
03a14c0db5 Merge pull request #20 from waveform80/when-active-when-inactive
Nicely named event attributes
2015-09-22 14:48:08 +01:00
Dave Jones
0c208efff8 Merge branch 'master' into when-active-when-inactive
Conflicts:
	gpiozero/devices.py
	gpiozero/input_devices.py
2015-09-22 12:55:56 +01:00
Dave Jones
b1913e5e39 Add events to all input devices
Fairly major tidy up of the hierarchy as well. There's now a trivial
base class: InputDevice which simply permits reading of state.
WaitableInputDevice descends from this and introduces waitable events
and callbacks, and provides a hook for calling them but needs further
machinery to activate that hook.

DigitalInputDevice (crap name?) descends from WaitableInputDevice and
uses the standard RPi.GPIO callback mechanisms to handle events. This is
intended for use with trivial on/off devices with predictably small
bounce times.

Next is SmoothedInputDevice (crap name?) which also descends from
WaitableInputDevice. This includes a background threaded queue which
constantly monitors the state of the device and provides a running mean
of its state. This is compared to a threshold for determining active /
inactive state. This is intended for use with on/off devices that
"jitter" a lot and for which a running average is therefore appropriate
or for devices which provide an effectively analog readout (like
charging capacitor timings).

MonitorSensor and LightSensor now descend from SmoothedInputDevice, and
Button descends from DigitalInputDevice. All "concrete" classes provide
event aliases appropriate to their function (e.g. when_dark,
when_pressed, etc.)
2015-09-22 12:48:09 +01:00
Ben Nuttall
ae1c31e313 pep8 cleanup 2015-09-22 09:36:25 +01:00
Ben Nuttall
41c1bfb18f Initial commit of basic Robot class 2015-09-21 21:11:56 +01:00
Ben Nuttall
e4742150c4 Add Ryanteck TrafficHat based on FishDish (untested) 2015-09-21 18:40:06 +01:00
Ben Nuttall
840953fd81 Refactor and add blink method to all boards 2015-09-21 18:22:49 +01:00
Ben Nuttall
be48a96e3e Blink defaults to 1 second on/off 2015-09-21 17:55:19 +01:00
Ben Nuttall
2172ed78db Add missing Buzzer import 2015-09-21 17:44:45 +01:00
Ben Nuttall
2de3d9a26b Merge pull request #18 from Gadgetoid/patch-1
Update __init__.py
2015-09-21 17:33:56 +01:00
Ben Nuttall
4403348917 Use super over re-implentation for PiTraffic 2015-09-21 17:30:11 +01:00