241 Commits

Author SHA1 Message Date
Dave Jones
8c4096b19c Some minor doc fixes for 1.2 2016-04-09 10:30:03 +01:00
Dave Jones
c2a9392ea5 Make tests work reliably on the Pi
While the tests work well on a PC or Travis, the Pi (where I ought to be
running them!) has some issues with the timing tests. Need to relax the
tolerance of the "assert_states_and_times" method to 0.05 seconds
otherwise it periodically fails even on something reasonably quick like
a Pi 2 (less failures on a Pi 3 but still occasionally).

Also reduced default fps to 25; if the default timing occasionally fails
on a Pi 2 it's evidently too fast for a Pi 1 and shouldn't be the
default; 25 also doesn't look any different to me on a pulsing LED.

There's also a bunch of miscellaneous fixes in here; last minute typos
and chart re-gens for the 1.2 release.
2016-04-08 23:11:14 +01:00
Andrew Scheller
9c99ffd40e Add LEDBarGraph to the composed_devices graph 2016-04-08 12:31:30 +01:00
Dave Jones
0838965796 Fix #115
Adds when_held event hook to Button (via extension of the EventsMixin
class). Also fixes some minor notes and activates codecov coverage
tracking.
2016-04-08 10:48:34 +01:00
Dave Jones
ee3bd6b532 Fix #204 and start readying the release
Also re-numbers energenie sockets 1-4 (as noted by @bennuttall in
comments to #239), and adds several "real pins" tests and board tests.
The bad-PWM stuff is currently disabled as it causes segfaults when
running the tests and I can't seem to trace the cause at the moment.
Finally, I've tweaked the deb config to suggest gpiozero, removed spidev
as a mandatory dep (which'll fix installs on wheezy for py3), and
there's some more miscellaneous last-minute stuff here that I can't
recall...
2016-04-06 23:06:46 +01:00
Dave Jones
6c39e7716f Merge pull request #246 from waveform80/pin-database
Add pins database
2016-04-05 00:51:27 +01:00
Dave Jones
50946b417c Add pins database
Related to @lurch's comments on #148, this PR contains a database of
pins for each Pi revision, along with various other bits of miscellany
(I might've gotten a bit carried away here...).

Any corrections/extensions welcome!
2016-04-05 00:44:19 +01:00
Dave Jones
69dd8a439a The source/values toolkit
Me and my big mouth. No sooner do I declare the base classes "relatively
stable" than I go and mess around with it all again. Anyway, this is the
long promised set of utilities to make source/values more interesting.
It includes a few interesting little utility functions, a whole bunch of
examples and introduces the notion of "pseudo" devices with no (obvious)
hardware representation like a time-of-day device.

This necessitated making the event system a little more generic (it's
not exclusive the GPIO devices after all; no reason we can't use it on
composite devices in future) and by this point the mixins have gotten
large enough to justify their own module.

The pseudo-devices are a bit spartan and basic at the moment but I'm
sure there'll be plenty of future ideas...
2016-04-04 23:59:05 +01:00
Dave Jones
6f3d34c91e Add DistanceSensor to the hierarchy diagram 2016-04-04 14:48:17 +01:00
Andrew Scheller
7f51251361 Typo 2016-04-04 10:29:52 +01:00
Dave Jones
68f0dffc38 Fix up GPIO device hierarchy diagram 2016-04-03 20:16:06 +01:00
Dave Jones
23a63697b6 Fix #109
Document and test the LineSensor class properly. Multi-sensor devices
can wait for now.
2016-04-03 00:09:02 +01:00
Dave Jones
6b2e014975 Fix #148
Added recipe for power/activity LEDs (on A+/B+/2B, with notes for other
models)
2016-04-01 23:09:52 +01:00
Dave Jones
8fc4b58ec2 Fix #182
Fixes LEDBarGraph (broken by snowpi updates) and adds PWM support and
relevant recipes
2016-04-01 20:05:10 +01:00
Dave Jones
759a6a58e6 Fix #140, fix #69, fix #185
This PR adds a software SPI implementation. Firstly this removes the
absolute necessity for spidev (#140), which also means when it's not
present things still work (effectively fixes #185), and also enables any
four pins to be used for SPI devices (which don't require the hardware
implementation).

The software implementation is simplistic but still supports clock
polarity and phase, select-high, and variable bits per word. However it
doesn't allow precise speeds to be implemented because it just wibbles
the clock as fast as it can (which being pure Python isn't actually that
fast).

Finally, because this PR involves creating a framework for "shared"
devices (like SPI devices with multiple channels), it made sense to bung
Energenie (#69) in as wells as this is a really simple shared device.
2016-04-01 12:57:17 +01:00
Ben Nuttall
e09e21a42e Fix typo 2016-03-20 13:34:50 +00:00
Dave Jones
ca7bfab916 Fix #231
Also added an indicator for the USB ports (not strictly accurate for the
Pi Zero, but still useful as an indicator of orientation)
2016-03-19 17:15:15 +00:00
Barry Byford
8ce5e12919 Correction on Traffic Lights Alternative recipe 2016-03-19 11:43:41 +00:00
Andrew Scheller
e5b7436d47 Documentation fix
To stop http://gpiozero.readthedocs.org/en/latest/api_pins.html#abstract-pin saying "class gpiozero.pins.native.Pin"
(which AFAICT is wrong)
2016-02-18 23:37:45 +00:00
Dave Jones
38b89a36f7 Work on #51 - add pot diagram 2016-02-13 10:06:27 +00:00
Dave Jones
e790a097bd Patched circuit diagrams
Thanks to @lurch for the suggestions!
2016-02-13 09:29:23 +00:00
Dave Jones
d090b03679 Work on #51
Some more circuit diagrams; better check these are accurate - I haven't
had time to wire them up and test them!
2016-02-13 00:45:22 +00:00
Dave Jones
0978b4c459 Merge pull request #192 from waveform80/pigpiod
Fix #180 - Add support for pigpio
2016-02-12 20:15:25 +00:00
Dave Jones
aebe42875d Fix #180 - Add support for pigpio 2016-02-12 20:14:10 +00:00
Dave Jones
83fb6ae8b4 Fix #114 - ultrasonic sensors
Implements support for the HC-SR04 ultrasonic sensor as an input device
class named DistanceSensor
2016-02-12 19:27:24 +00:00
Dave Jones
1f2140a9f5 Work on #87
Implement a test suite, including Travis-CI integration
2016-02-11 21:11:22 +00:00
Ben Nuttall
29bcada1f9 Add CamJamKitRobot to changelog 2016-02-09 22:38:07 +00:00
Dave Jones
b4a8273472 Bump version and update changelog for 1.1
Includes some last minute changes too
2016-02-08 23:37:13 +00:00
Dave Jones
8e0c6e243b Refactor low level implementation
This commit is a fairly major piece of work that abstracts all pin
operations (function, state, edge detection, PWM, etc.) into a base
"Pin" class which is then used by input/output/composite devices to
perform all required configuration.

The idea is to pave the way for I2C based IO extenders which can present
additional GPIO ports with similar capabilities to the Pi's "native"
GPIO ports. As a bonus it also abstracts away the reliance on the
RPi.GPIO library to allow alternative pin implementations (e.g. using
RPIO to take advantage of DMA based PWM), or even pure Python
implementations.
2016-02-08 14:54:18 +00:00
Dave Jones
c7ee499989 Merge pull request #177 from waveform80/misc-11
Miscellaneous minor changes for 1.1
2016-02-08 13:37:14 +00:00
Dave Jones
55e99f379a Merge-clean update of PR #126
This is an updated cherry-pick of Martin O'Hanlon's LEDBarGraph class.
2016-02-08 12:54:55 +00:00
Dave Jones
006c10cce0 Miscellaneous minor changes for 1.1 2016-02-08 12:01:42 +00:00
Dave Jones
9871ac3dca Fix #135 2016-02-08 00:33:05 +00:00
Dave Jones
7099b56974 Fix #168 2016-02-07 19:54:39 +00:00
Dave Jones
183b854717 Fix #119
Add a bunch of code snippets demonstrating generators to the recipes
chapter, including a temperature recipe for the MCP3008.
2016-02-07 19:45:52 +00:00
Dave Jones
e52ad37200 Fix prototypes in docs
The prototypes in the docs are rigged to make out the first parameter as
mandatory (as it effectively is); however this does mean you've got to
remember to update the prototype when you modify it in the code! :)
2016-01-31 20:07:34 +00:00
Dave Jones
44e943b322 Re-apply #120 and #117 to rest-docs
Knew I'd missed some patches to the docs! This re-applies the
aforementioned doc patches and also fixes the last RGBLED example (which
was subtly incorrect in the original docs)
2016-01-31 19:28:35 +00:00
Andrew Scheller
7ea312acb9 Move LED example from GPIO2 to GPIO17 2016-01-31 15:54:57 +00:00
Dave Jones
cf18fb971e Fix #121
Change parent of PWMOutputDevice to OutputDevice and implement blink to
maintain compatibility. The version of blink implemented here is
slightly extended to include functionality like Explorer HAT's "pulse".
The parameter defaults behave identically to OutputDevice's blink but
can be adjusted to have the device smoothly fade in and out.
2016-01-31 13:47:11 +00:00
Dave Jones
0bc62aee73 Generic docs need reST
Conversion of all docs to reST so that the generic docs can link easily
with the rest of the docs.
2016-01-30 23:40:12 +00:00
Ben Nuttall
e172caf2cb Merge branch 'master' of github.com:rpi-distro/python-gpiozero 2016-01-04 14:37:04 +00:00
Ben Nuttall
61f4b4919b Correct RGBLED recipe 2016-01-04 14:36:55 +00:00
Andrew Scheller
21f542cb8d Fix upgrade instructions
'apt-get upgrade' always upgrades all packages, to upgrade a single package we need to use 'apt-get install'
2015-12-01 10:19:57 +00:00
Ben Nuttall
942859b5a2 Merge branch 'master' of github.com:rpi-distro/python-gpiozero 2015-11-28 02:58:46 +00:00
Ben Nuttall
81a782b5f3 Add apt install instructions 2015-11-28 02:58:37 +00:00
Ben Nuttall
dbb95b5e37 Fix typo 2015-11-23 11:32:35 +00:00
Andrew Scheller
f55d92e9db Update recipes
Remove superfluous function from Music Box example, and add pause() to all the recipes that need it
2015-11-19 12:16:39 +00:00
Andrew Scheller
ccd880424b typo 2015-11-19 02:04:15 +00:00
Dave Hughes
f1299037b5 Bump versions for release 2015-11-16 12:15:39 +00:00
Andrew Scheller
f1e3ee03b3 Minor typo 2015-11-16 10:34:40 +00:00