Commit Graph

153 Commits

Author SHA1 Message Date
Dave Jones 6de9473274 Merge pull request #88 from tjguk/robot-fix
Fix incorrect variable name
2015-10-24 12:16:37 +01:00
Tim Golden 3d468d764f Fix incorrect variable name 2015-10-24 11:38:01 +01:00
Ben Nuttall 8bdbac2630 Merge pull request #86 from waveform80/moar-sources
Fix #76, fix #79
2015-10-22 21:46:33 +01:00
Dave Jones fa0a1b3cdd Fix #76, fix #79
This finishes off implementing values and source for all (current)
classes in gpiozero. I'm afraid things get rather complex in this
commit. For starters, we've now got quite a few "aggregate" classes
which necessarily don't descend from GPIODevice. To implement values and
source on these I could either repeat a helluva lot of code or ... turn
to mixin classes. Yeah, it's multiple inheritance time, baby!

Unfortunately multiple inheritance doesn't work with __slots__ but we
really ought to keep functionality that they provide us (raise
AttributeError when an unknown attribute is set). So I've implemented
this with ... erm ... metaclasses. Sorry!
2015-10-22 21:44:42 +01:00
Ben Nuttall b0b54162cc Merge pull request #83 from waveform80/sources-and-values
Fix #76
2015-10-19 11:49:07 +01:00
Dave Jones f6294a5bf4 Fix #76
Makes `value` an alias of `is_active` in the base `GPIODevice`, and
`values` an infinite iterable of this value. Then adds `source` property
to `OutputDevice` allowing simple linkage of devices via iterators.
2015-10-19 11:01:09 +01:00
Ben Nuttall 0805579175 Add 'Initialisation options' to docs 2015-10-18 22:57:22 +01:00
Ben Nuttall d61f0ff5ec Make default arguments bold 2015-10-18 12:28:53 +01:00
Ben Nuttall d9bbed2cdf Update release date in docs 2015-10-18 10:46:12 +01:00
Ben Nuttall 3230f3ae18 Add PWMLED, close #58 2015-10-17 22:11:59 +01:00
Ben Nuttall fec4bcc844 Merge pull request #77 from waveform80/moar-aliases
Fix #74
2015-10-17 22:06:41 +01:00
Dave Jones 6583223299 Fix #74
Add more property aliases and do them properly (no more lambdas and
string lookups) which means we can remove `_alias`. This commit also
defines `__slots__` for all classes which should prevent assignation of
invalid attributes with an AttributeError (more friendly than silently
doing the wrong thing). Finally, it cleans up all the property defs to
use Ben's preferred decorator style.
2015-10-17 22:04:52 +01:00
Ben Nuttall cc79749758 Update docs 2015-10-17 15:28:10 +01:00
Ben Nuttall b7cce51497 Update docs for v0.8.0 2015-10-17 12:36:41 +01:00
Ben Nuttall fcc7c47fe3 Release v0.8.0 beta 3 v0.8.0 2015-10-16 11:40:42 +01:00
Ben Nuttall e1868cdcb5 Merge pull request #73 from waveform80/analog-input-device
Fix #41
2015-10-15 10:29:30 +01:00
Dave Jones a347a2ca4e Fix #41
Add `AnalogInputDevice` base class and extend `MCP3008` (and `MCP3004`)
classes from it.
2015-10-15 10:18:28 +01:00
Ben Nuttall fc1fe62bfe Fix copy-paste error on LED pin numbers, close #71 2015-10-14 12:18:42 +01:00
Ben Nuttall 7bf0561cb6 Remove relay class, re: #66 2015-10-14 12:17:49 +01:00
Ben Nuttall 9e5579aa2b Merge pull request #70 from waveform80/relay-and-active-high
Fix #66 - Add Relay and make active_high configurable
2015-10-14 12:16:21 +01:00
Dave Jones 924850ccde Fix #66
This PR adds the `active_high` parameter (defaulted to `True`) to the
`OutputDevice` class. This permits flipping the logic of an output
device in a similar manner to `pull_up` on `InputDevice`.

It also adds a `Relay` class derived from `DigitalOutputDevice` which
uses this parameter to flip the logic (as this is typically required
with relays).
2015-10-14 12:10:36 +01:00
Dave Jones 7dda0fe5b7 Merge pull request #72 from waveform80/fix-rgb-leds
Fix #68
2015-10-14 12:07:56 +01:00
Dave Jones 250ba454d9 Fix #68
Actually, this isn't so much a fix as a re-working of RGBLED. This
renames the `rgb` property to `color` because that's what the property
really represents (combined with `picamera.Color` this lets you do stuff
like `rgb_led.color = Color('red')`), and simplifies the internals of
the class. It also adds the common `close` method and context manager
capabilities.

Finally, it corrects an error I hadn't noticed earlier where
PWMOutputDevice isn't properly cleaning up PWM threads on close.
2015-10-14 12:05:44 +01:00
Dave Jones 612975e618 Merge pull request #67 from waveform80/response-pir
Fix #64
2015-10-13 22:00:59 +01:00
Dave Jones 53f3a3c69f Fix #64
Make MotionSensor more responsive by effectively removing the averaging
queue. Also add note on how to smooth out "jittery" PIR sensors by
increasing the queue length back up to 5.
2015-10-13 22:00:09 +01:00
Ben Nuttall 43fdf71ae3 Use second level headers on notes page 2015-10-13 14:45:56 +01:00
Ben Nuttall 7c21ed2ca6 Merge pull request #65 from ryanteck/master
Fix TrafficHat numbering to match promo photos
2015-10-13 14:06:38 +01:00
Ryan Walmsley f1771c1f05 Fixed TrafficHat numbering to match promo photos etc. 2015-10-13 13:52:39 +01:00
Dave Jones 467ed0ddcd Merge pull request #63 from waveform80/fix-notes-2
Fix Notes
2015-10-12 22:18:38 +01:00
Dave Jones f0eefdb8f2 Fix Notes
Notes now works with embedded code sections, but the spacing is still
wrong as is the language selection. Oh well, come back to it later...
2015-10-12 22:17:45 +01:00
Dave Jones d7e5ae218b Merge pull request #62 from waveform80/fix-notes
Attempt to fix example syntax sections
2015-10-12 19:37:48 +01:00
Dave Jones 28f57d2710 Attempt to fix example syntax sections
Something fishy going on with the Markdown for the code examples in the
Notes page. Might be down to the indentation of the list item's content?
The vim markdown parser seems to think so anyway; let's see what
pythonhosted.org says ...
2015-10-12 19:35:09 +01:00
Dave Jones f6c69e80ef Merge pull request #61 from waveform80/output-read-write
Fix #57
2015-10-12 15:47:22 +01:00
Dave Jones bb6523a95b Fix #57
This refactors the GPIOOutputDevice to have an internal `_write` method
similar to the `_read` method used to grab the value of a GPIO device.
This is used for simple 1s and 0s until we get to PWMOutputDevice which
replaces the value with the PWM device's duty cycle level. As a result,
all the DigitalOutputDevice base methods (including blink) "just work".

This commit also, for the moment, removes min_pwm and max_pwm because
I'm not 100% certain how they should interact with the notion of
is_active at the moment. They'll probably get added back in at some
point but I need a bit more time to think about it!
2015-10-12 15:46:48 +01:00
Ben Nuttall 8cfe8152a9 Merge pull request #60 from waveform80/safe-fail-init
Fix #50
2015-10-12 14:52:11 +01:00
Dave Jones 2d161f560f Fix #50
This isn't a full fix but I can't seem to reproduce the issue in #50 at
the moment. So for now this just ensures that exceptions in the
constructors get cleaned up properly (so they don't block future
construction attempts against the same pin)
2015-10-12 10:15:09 +01:00
Ben Nuttall 3ce4151bb7 Fix faulty PWMOutputDevice value setter 2015-10-12 00:24:46 +01:00
Ben Nuttall 3f18b3f4b7 Add some circuit diagrams and update docs 2015-10-11 00:45:28 +01:00
Ben Nuttall b3915859da Expand readme 2015-10-10 19:33:05 +01:00
Ben Nuttall e3a3f03247 Expand readme and docs index 2015-10-10 19:21:16 +01:00
Ben Nuttall d91a65bdfd Add button and keyboard robot controller recipes 2015-10-10 18:26:02 +01:00
Ben Nuttall ac5eb7ece1 Merge pull request #54 from waveform80/raspbian-packaging
Fix #44
2015-10-10 15:58:43 +01:00
Dave Jones c8105c8dc3 Fix #44
Implement native Debian packaging (control files are part of the source
repo) with Makefile to simplify the release procedure.
2015-10-10 15:54:08 +01:00
Ben Nuttall 17c93d1e45 Release v0.7.0 beta 2 v0.7.0 2015-10-09 12:30:13 +01:00
Ben Nuttall ee36451bed Make Motors PWM devices with optional speed argument on methods 2015-10-07 17:09:28 +01:00
Ben Nuttall 65b5ba9ea6 Clean up boards docs page 2015-10-07 15:00:53 +01:00
Ben Nuttall ae19496ab5 Correct heading of Robot interface in docs 2015-10-06 17:12:30 +01:00
Ben Nuttall 1c9ea6c943 Add motor, robot and motion sensor robot examples 2015-10-06 17:03:13 +01:00
Ben Nuttall 493b4e1cda Change RGBLED interface from 0-100 to 0-255, close #40 2015-10-05 13:26:01 +01:00
Ben Nuttall c26c279174 Change PWM interface from 0-100 to 0-1, close #45 2015-10-05 12:37:43 +01:00