Commit Graph

106 Commits

Author SHA1 Message Date
ubuntu
8d457df2e2 Document how to get the gpiozero version number 2016-06-18 20:44:46 +01:00
Alex Eames
c522d60e25 Update recipes.rst
Small correction. LED to PWMLED in the Light Sensor 2nd example
2016-04-28 15:36:51 +01:00
Ben Nuttall
848d030ac9 Remove with blocks for consistency, re: #239 2016-04-21 23:55:04 +01:00
Dave Jones
663994c8a5 Merge pull request #293 from lurch/patch-5
Make Potentiometer Recipe more efficient
2016-04-21 23:28:58 +01:00
Andrew Scheller
5f336ad2b2 Make Potentiometer Recipe more efficient 2016-04-19 22:16:42 +01:00
Andrew Scheller
9ca4af39de Add extra Source Tools functions: smoothed, summed and multiplied 2016-04-19 22:02:01 +01:00
Edward Betts
40f64bc2b5 correct spelling of Artificial (#285)
* correct spelling of Artificial

* add extra = to fix heading
2016-04-17 23:10:35 +01:00
Dave Jones
79a0fd2a27 Fix #278
Allow the creation of remote pins easily with PiGPIOPin. Also changes
DefaultPin to a pin_factory callable which accepts the input pin number.
2016-04-16 00:30:22 +01:00
Dave Jones
43c69b9435 Update graphs for #277 2016-04-15 16:52:31 +01:00
Andrew Scheller
66264001e5 Docs update - Motor is composed of two PWMOutputDevices 2016-04-13 16:30:50 +01:00
Ben Nuttall
76ba188f85 Add missing SnowPi docs 2016-04-13 12:12:47 +01:00
Ben Nuttall
56bd1b3c46 Merge pull request #243 from waveform80/keyboard-robot
Fix #237
2016-04-10 20:55:26 +01:00
Dave Jones
bb13e9fe12 Fix #237
Adds a keyboard controlled robot recipe that uses curses. Advantage is
that no external deps are required, disadvantages are that it'll only
work from a terminal (or terminal window, basically not IDLE).
2016-04-10 20:48:30 +01:00
Dave Jones
f82ddad1fc Last minute changes for 1.2
Warnings about non-physical pins, and period specification for
sin/cosine waves in tools
2016-04-10 20:09:12 +01:00
Dave Jones
ecc8df8041 Doc reorganization 2016-04-10 16:47:16 +01:00
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