Commit Graph

341 Commits

Author SHA1 Message Date
Dave Jones
a59f8f6b35 Merge pull request #242 from waveform80/built-in-leds
Fix #148
2016-04-01 23:15:08 +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
af94fc2aac Merge pull request #241 from waveform80/bar-graph-pwm
Fix #182
2016-04-01 20:22:15 +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
d1669b80d9 Merge pull request #240 from waveform80/snowpi
Fix #130, fix #131, fix #189
2016-04-01 17:35:40 +01:00
Dave Jones
d6af02933a Fix #130, fix #131, fix #189
This PR implements SnowPi, adds the ability for LEDBoard's to own other
LEDBoards as well as LEDs, and enhances blink so that manually
controlling a LED automatically stops it from blinking (no matter
whether it's blinking itself or a LEDBoard is blinking it).

It also fixes up RGBLED and Motor which I managed to break with the last
PR ...
2016-04-01 17:32:46 +01:00
Dave Jones
a7b7fc8dec Merge pull request #239 from waveform80/energenie
Fix #140, fix #69, fix #185
2016-04-01 13:00:16 +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
bc0ced4320 Merge pull request #236 from waveform80/pi3-pins
Fix #231
2016-03-19 18:06:35 +00:00
Dave Jones
72b1857ea6 Merge pull request #235 from waveform80/fix-float-bounce
Fix #229
2016-03-19 18:06:23 +00:00
Dave Jones
93879daaa0 Merge pull request #234 from waveform80/source-delay
Fix #181
2016-03-19 18:06:01 +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
Dave Jones
9432046392 Fix #229
Make sure bounce is always integer when passed to RPi.GPIO and RPIO, and
added some checks to make sure a negative bounce isn't specified either
2016-03-19 17:02:46 +00:00
Dave Jones
351a323832 Fix #181
Added source_delay property to SourceMixin which means it'll now appear
everywhere. Default is 0.01 which is just enough to drop CPU usage while
remaining responsive enough for the majority of purposes.
2016-03-19 16:55:04 +00:00
Ben Nuttall
807bdff2e4 Merge pull request #233 from ukBaz/ukBaz-patch-1
Correction on Traffic Lights Alternative recipe
2016-03-19 12:55:58 +00:00
Barry Byford
8ce5e12919 Correction on Traffic Lights Alternative recipe 2016-03-19 11:43:41 +00:00
Dave Jones
3d78d76463 Merge pull request #224 from lurch/patch-1
PiGPIOPin fixup
2016-02-23 09:35:14 +00:00
Andrew Scheller
f476bbe458 PiGPIOPin fixup
raise correct exception for invalid pin numbers
2016-02-22 23:49:35 +00:00
Dave Jones
672c793510 Merge pull request #223 from lurch/patch-1
Add link to CONTRIBUTING doc to README
2016-02-22 12:28:57 +00:00
Andrew Scheller
3eaa1aa896 Add link to CONTRIBUTING doc to README
And remove the duplicate link definitions for `Ben Nuttall` and `Dave Jones`
2016-02-22 11:11:23 +00:00
Dave Jones
aa6bd63883 Merge pull request #221 from lurch/patch-1
RPIOPin fixups
2016-02-22 09:51:31 +00:00
Andrew Scheller
2495e903df RPIOPin fixups
...as discovered using the new real_pins unit-tests.
2016-02-22 02:46:19 +00:00
Dave Jones
591df70296 Merge pull request #220 from waveform80/test-real-pins
Add "real" pins tests
2016-02-21 23:21:23 +00:00
Dave Jones
b6fb4e4d89 Add "real" pins tests
This is just a quicky for people to start playing with - it's not
complete in any way, shape, or form. This is how I envisage the "real"
pin tests being done; part of the test suite with a `skipif` to ensure
they don't get run on non-Pi platforms, with a fixture to loop over
whatever pin implementations are found (we can't always assume all of
them: for example, RPIO doesn't work on a Pi 2), and a relatively simple
wiring for the test.

In this case I've assumed GPIOs 22 and 27 are wired together. They're
next to each other, so a jumper is sufficient to run the test.

PRs extending the coverage are very welcome (I've already discovered and
fixed several silly bugs in NativePin!). I've left all the interesting
hard stuff for people to play with (PWM testing: statistical sampling?
debounce compensation testing: timing?). When I've got a second, I'll
looking into hooking up my Pi Zero as a Travis-esque test-bed for this,
triggered by GitHub webhooks (not sure how I'll deal with reporting
yet).
2016-02-21 23:16:24 +00:00
Dave Jones
79814eaa1c Merge pull request #218 from lurch/more_mockpin_tweaks
More small MockPin tweaks
2016-02-21 01:33:30 +00:00
Andrew Scheller
741a8ec7f3 More small MockPin tweaks 2016-02-21 01:24:10 +00:00
Dave Jones
ee7d5c5df7 Merge pull request #217 from lurch/mock_tweak
MockPin improvements
2016-02-21 00:44:12 +00:00
Andrew Scheller
c0d70f35f6 MockPin improvements
Change MockPin (and MockPWMPin) to make them behave more like 'real' pins - fixes #206
Add new MockPin tests, and rework some of the existing ones
Incorporate #216
2016-02-21 00:35:01 +00:00
Dave Jones
80dfee5c3f Merge pull request #211 from lurch/patch-2
RPiGPIOPin fixups
2016-02-20 17:51:11 +00:00
Dave Jones
50964a41ec Merge pull request #214 from lurch/patch-4
MockPin fixups
2016-02-20 17:41:46 +00:00
Dave Jones
8c53fad61e Merge pull request #213 from lurch/patch-3
NativePin fixups
2016-02-20 17:38:02 +00:00
Andrew Scheller
d914c79207 Small change to test_mock_pin_frequency_unsupported 2016-02-20 17:35:24 +00:00
Andrew Scheller
768a27a71b MockPin fixups
* alter the PinSetInput exception message to match other `Pin` implementations
* constrain the state of MockPin to a `bool`, and the state of MockPWMPin to a `float`
* allow MockPin to have a `None` frequency set, matching the docs http://gpiozero.readthedocs.org/en/latest/api_pins.html#gpiozero.pins.Pin.frequency
2016-02-20 17:32:11 +00:00
Dave Jones
5017557b73 Merge pull request #210 from lurch/patch-1
'Fix' test_mock_pin_frequency_unsupported
2016-02-20 17:26:26 +00:00
Andrew Scheller
c878b20bcc NativePin fixups
* rename FUNCTION / PULL / EDGES dictionaries so that they better-match the other `Pin` implementations
* throw `PinSetInput` if trying to set the state of an input pin
2016-02-20 17:15:34 +00:00
Andrew Scheller
9883cf901a RPiGPIO fixups
* Imported missing exceptions
* Corrected wrong PinInvalidValue exception
* GPIO.PWM is a class (GPIO.HARD_PWM is the constant)
* GPIO.setup only supports setting input and output modes https://sourceforge.net/p/raspberry-gpio-python/code/ci/default/tree/source/py_gpio.c#l264
2016-02-20 15:37:13 +00:00
Andrew Scheller
5c5934a8f3 'Fixed' test_mock_pin_frequency_unsupported
See the discussion at https://github.com/RPi-Distro/python-gpiozero/issues/206#issuecomment-186289488
2016-02-20 13:42:54 +00:00
Dave Jones
b1943c978e Merge pull request #203 from lurch/patch-4
Catch AttributeError inside GPIODevice._read
2016-02-19 11:26:43 +00:00
Dave Jones
b30e8c2830 Merge pull request #205 from lurch/patch-5
Documentation fix
2016-02-19 11:14:08 +00:00
Andrew Scheller
d1bb5fe66a Added another unit test 2016-02-19 00:19: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
Andrew Scheller
504b0b9047 Add some GPIODevice unit-tests 2016-02-18 20:01:13 +00:00
Andrew Scheller
d970af73fd Catch AttributeError inside GPIODevice._read
Fixes #202
2016-02-18 18:53:52 +00:00
Dave Jones
9cc9242f27 Merge pull request #201 from lurch/patch-3
Add .cache directory to .gitignore
2016-02-17 20:21:54 +00:00
Andrew Scheller
fc95cd8056 Add .cache directory to .gitignore
Seems to get created during `make test`
2016-02-17 12:36:40 +00:00
Ben Nuttall
ec4fab47bf Add Schelto vanDoorn to list of contributors 2016-02-14 16:52:21 +00:00
Ben Nuttall
1285f1ffbb Add Andrew Scheller to list of contributors
Thanks @lurch
2016-02-14 13:43:40 +00:00
Ben Nuttall
72afe2250a Expose all MCP* classes added in #162 2016-02-14 13:23:29 +00:00
Ben Nuttall
91cc0620ee Add Slack notification 2016-02-14 01:02:05 +00:00