From 705dbeb2c17d0dc53e0d439d0961376ea0243a40 Mon Sep 17 00:00:00 2001 From: Martin O'Hanlon Date: Fri, 18 Nov 2022 09:20:13 +0000 Subject: [PATCH 1/3] pot led example --- docs/examples/pot_led.py | 10 ++++++++++ docs/recipes.rst | 4 ++++ 2 files changed, 14 insertions(+) create mode 100644 docs/examples/pot_led.py diff --git a/docs/examples/pot_led.py b/docs/examples/pot_led.py new file mode 100644 index 0000000..a9daa57 --- /dev/null +++ b/docs/examples/pot_led.py @@ -0,0 +1,10 @@ +from picozero import Pot, LED + +# Potentiometer connected to GP26 (ADC0), GND and 3V +# LED connected to GP0 + +pot = Pot(26) +led = LED(0) + +while True: + led.value = pot.value \ No newline at end of file diff --git a/docs/recipes.rst b/docs/recipes.rst index 87438d1..e8221f2 100644 --- a/docs/recipes.rst +++ b/docs/recipes.rst @@ -154,6 +154,10 @@ Print the value, voltage and percent reported by a potentiometer: In the Thonny Python editor, choose View->Plotter to plot the output of :meth:`print`. +Use a potentiometer to control the brightness of an LED: + +.. literalinclude:: examples/pot_led.py + Buzzer ------ From f3098778b6cc8daac49ed88d011e85eb5d61d1b0 Mon Sep 17 00:00:00 2001 From: Martin O'Hanlon Date: Fri, 18 Nov 2022 09:31:13 +0000 Subject: [PATCH 2/3] v0.4.0 --- docs/changelog.rst | 6 ++++++ docs/conf.py | 2 +- picozero/__init__.py | 2 +- setup.py | 4 ++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 902afc2..0a84160 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -3,6 +3,12 @@ Change log .. currentmodule:: picozero +0.4.0 - 2022-11-18 +~~~~~~~~~~~~~~~~~~ + ++ Introduced `Servo` classes ++ Documentation fixes + 0.3.0 - 2022-08-12 ~~~~~~~~~~~~~~~~~~ diff --git a/docs/conf.py b/docs/conf.py index ae1a7e4..eb4c8fc 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -47,7 +47,7 @@ def __getattr__(cls, name): author = 'Raspberry Pi Foundation' # The full version, including alpha/beta/rc tags -release = '0.3.0' +release = '0.4.0' # -- General configuration --------------------------------------------------- diff --git a/picozero/__init__.py b/picozero/__init__.py index 6c6b963..feecead 100644 --- a/picozero/__init__.py +++ b/picozero/__init__.py @@ -1,6 +1,6 @@ __name__ = "picozero" __package__ = "picozero" -__version__ = '0.3.0' +__version__ = '0.4.0' __author__ = "Raspberry Pi Foundation" from .picozero import ( diff --git a/setup.py b/setup.py index 7644328..1afd37b 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ __project__ = 'picozero' __packages__ = ['picozero'] __desc__ = 'A beginner-friendly library for using common electronics components with the Raspberry Pi Pico. ' -__version__ = '0.3.0' +__version__ = '0.4.0' __author__ = "Raspberry Pi Foundation" __author_email__ = 'learning@raspberrypi.org' __license__ = 'MIT' @@ -15,7 +15,7 @@ 'electronics', ] __classifiers__ = [ - 'Development Status :: 1 - Planning', + 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: Education', 'Programming Language :: Python :: Implementation :: MicroPython', From f2fd3799e9242ec874399ffac8c034f406421c33 Mon Sep 17 00:00:00 2001 From: Martin O'Hanlon Date: Fri, 18 Nov 2022 09:32:32 +0000 Subject: [PATCH 3/3] typo --- docs/changelog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 0a84160..3e77dde 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -6,7 +6,7 @@ Change log 0.4.0 - 2022-11-18 ~~~~~~~~~~~~~~~~~~ -+ Introduced `Servo` classes ++ Introduced ``Servo`` class + Documentation fixes 0.3.0 - 2022-08-12