Skip to content

Commit 028ef3a

Browse files
author
Martin O'Hanlon
authored
Merge pull request #62 from RaspberryPiFoundation/led
led compatibility fix
2 parents 878b25a + b42f7b1 commit 028ef3a

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

docs/developing.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,17 @@ Development
33

44
Instructions on how build and deploy picozero.
55

6+
Pre-requisites
7+
--------------
8+
9+
To build and deploy picozero, you need to install the dependencies ::
10+
11+
pip3 install twine sphinx
12+
613
Build
714
-----
815

9-
1. Update version numbers in the ``setup.py``, ``picozero/__init__.py``and ``docs/conf.py`` files.
16+
1. Update version numbers in the ``setup.py``, ``picozero/__init__.py`` and ``docs/conf.py`` files.
1017

1118
2. Add release to ``docs/changelog.rst``
1219

picozero/picozero.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,11 @@ def LED(pin, use_pwm=True, active_high=True, initial_value=False):
571571
active_high=active_high,
572572
initial_value=initial_value)
573573

574-
pico_led = LED(25)
574+
try:
575+
pico_led = LED("LED", use_pwm=False)
576+
except TypeError:
577+
# older version of micropython before "LED" was supported
578+
pico_led = LED(25, use_pwm=False)
575579

576580
class PWMBuzzer(PWMOutputDevice):
577581
"""

0 commit comments

Comments
 (0)