From c8a19047b10481f52a0e9ebc9c378b5a2dc27175 Mon Sep 17 00:00:00 2001 From: Frank Wiebenga Date: Tue, 26 Jan 2021 12:56:38 -0600 Subject: [PATCH 1/7] Update temperature.py Add some comments from the RP2040 datasheet that helps new users understand where the constant number values came from. --- adc/temperature.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/adc/temperature.py b/adc/temperature.py index a62a23a..77b78ea 100644 --- a/adc/temperature.py +++ b/adc/temperature.py @@ -7,6 +7,8 @@ conversion_factor = 3.3 / (65535) while True: reading = sensor_temp.read_u16() * conversion_factor + # The temperature sensor measures the Vbe voltage of a biased bipolar diode, connected to the fifth ADC channel + # Typically, Vbe = 0.706V at 27 degrees C, with a slope of -1.721mV (0.001721) per degree. temperature = 27 - (reading - 0.706)/0.001721 print(temperature) utime.sleep(2) From 9510fa2fc765180b28049800ad6e29c80d35b61e Mon Sep 17 00:00:00 2001 From: Alasdair Allan Date: Wed, 27 Jan 2021 23:58:53 +0000 Subject: [PATCH 2/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c08ac8..5966cf9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MicroPython Examples -Examples to accompany the "Raspberry Pi Pico Python SDK" book. +Examples to accompany the "[Raspberry Pi Pico Python SDK](https://datasheets.raspberrypi.org/pico/raspberry-pi-pico-python-sdk.pdf)" book which forms part of the technical documentation published by Raspberry Pi Trading ## Contributions From 26a62a6baeb95b0138e7aa161b99bf74ae5eaa86 Mon Sep 17 00:00:00 2001 From: Alasdair Allan Date: Thu, 28 Jan 2021 00:00:26 +0000 Subject: [PATCH 3/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5966cf9..9f9d802 100644 --- a/README.md +++ b/README.md @@ -6,4 +6,4 @@ Examples to accompany the "[Raspberry Pi Pico Python SDK](https://datasheets.ras While we welcome pull requests to contribute further example code, please do not link to personal sites or to your social media. Contributions which are fully documented with an AsciiDoc description and a Fritzing wiring diagram, e.g. see the [NeoPixel Ring](https://github.com/raspberrypi/pico-micropython-examples/tree/master/pio/neopixel_ring) example, stand more chance of inclusion. -Our example code is under the BSD-3-Clause License. Any contributions must be under the same license. +Our example code is under the BSD-3-Clause License: any contributions must be under the same license. From 1ebb90104539b0b83c7d7a68b9465fc189d31e15 Mon Sep 17 00:00:00 2001 From: Alasdair Allan Date: Thu, 28 Jan 2021 00:14:38 +0000 Subject: [PATCH 4/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f9d802..61e814f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MicroPython Examples -Examples to accompany the "[Raspberry Pi Pico Python SDK](https://datasheets.raspberrypi.org/pico/raspberry-pi-pico-python-sdk.pdf)" book which forms part of the technical documentation published by Raspberry Pi Trading +Examples to accompany the "[Raspberry Pi Pico Python SDK](https://datasheets.raspberrypi.org/pico/raspberry-pi-pico-python-sdk.pdf)" book published by Raspberry Pi Trading, which forms part of the technical documentation in support of Raspberry Pi Pico and the MicroPython port to RP2040. ## Contributions From f4f14dbadc8775ddf9ed51331c15d049e53e6ad1 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Thu, 4 Feb 2021 08:25:31 +0100 Subject: [PATCH 5/7] pio/pio_blink.py: fix missing rp2 import. --- pio/pio_blink.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pio/pio_blink.py b/pio/pio_blink.py index 566a3cf..e395204 100644 --- a/pio/pio_blink.py +++ b/pio/pio_blink.py @@ -1,10 +1,10 @@ import time -from rp2 import PIO, asm_pio +import rp2 from machine import Pin # Define the blink program. It has one GPIO to bind to on the set instruction, which is an output pin. # Use lots of delays to make the blinking visible by eye. -@asm_pio(set_init=rp2.PIO.OUT_LOW) +@rp2.asm_pio(set_init=rp2.PIO.OUT_LOW) def blink(): wrap_target() set(pins, 1) [31] From c87358869359bf0647e32d5a2f551ab32ca68e97 Mon Sep 17 00:00:00 2001 From: Alasdair Allan Date: Thu, 4 Feb 2021 11:13:40 +0000 Subject: [PATCH 6/7] Update pio_spi.py Missing import, see comments in raspberrypi/pico-micropython-examples#14 --- pio/pio_spi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pio/pio_spi.py b/pio/pio_spi.py index eb5490a..3964061 100644 --- a/pio/pio_spi.py +++ b/pio/pio_spi.py @@ -1,3 +1,4 @@ +from rp2 import PIO, asm_pio from machine import Pin @rp2.asm_pio(out_shiftdir=0, autopull=True, pull_thresh=8, autopush=True, push_thresh=8, sideset_init=(rp2.PIO.OUT_LOW, rp2.PIO.OUT_HIGH), out_init=rp2.PIO.OUT_LOW) @@ -45,4 +46,4 @@ class PIOSPI: for b in wdata: self._sm.put(b << 24) rdata.append(self._sm.get() & 0xff) - return rdata \ No newline at end of file + return rdata From f16d90de302c6042c29814fcf149acacc71d05b8 Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Thu, 4 Feb 2021 11:46:43 +0000 Subject: [PATCH 7/7] Fix import in pio_spi.py --- pio/pio_spi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pio/pio_spi.py b/pio/pio_spi.py index 3964061..30f02c3 100644 --- a/pio/pio_spi.py +++ b/pio/pio_spi.py @@ -1,4 +1,4 @@ -from rp2 import PIO, asm_pio +import rp2 from machine import Pin @rp2.asm_pio(out_shiftdir=0, autopull=True, pull_thresh=8, autopush=True, push_thresh=8, sideset_init=(rp2.PIO.OUT_LOW, rp2.PIO.OUT_HIGH), out_init=rp2.PIO.OUT_LOW)