pico-feedback's Issues
C SDK - 4.1.10. hardware_i2c - Example output incorrect
raspberry-pi-pico-c-sdk.pdf section 4.1.10. hardware_i2c says:
4 // I2C Bus Scan
5 // 0 1 2 3 4 5 6 7 8 9 A B C D E F
6 // 0
7 // 1 @
8 // 2
9 // 3 @
10 // 4
11 // 5
12 // 6
13 // 7
14 //
15 // E.g. if slave addresses 0x12 and 0x34 were acknowledged.
This is incorrect. Actual output of the sample code is formatted differently. The vertical axis shows all significant digits of the hex value and empty cells are represented with a period (.) as shown below taken from actual output:
// I2C Bus Scan
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
// 00 . . . . . . . . . . . . . . . .
// 10 . . . . . . . . . . . . . . . .
// 20 . . . . . . . . . . . . . . . .
// 30 . . . . . . . . . . . . . . . .
// 40 . . . . . . . . . . . . . . . .
// 50 . . . . . . . . . . @ . . . . .
// 60 . . . . . . . . . . . . . . . .
// 70 . . . . . . . . . . . . . . . .
// Done.
Grammar/typo in datasheet, 2.15.3.2
build-date: 2021-01-26
build-version: b4f84f3-dirty
2.15.3.2, start of paragraph 2
"Clock glitches should avoided at all costs" -> "Clock glitches should be avoided at all costs"
Multicore RPC
Just wanted to let you know about the Embedded RPC (eRPC) project that is designed specifically to be used in small heterogenous multicore systems. eRPC makes it very easy to build RPC services for calling between cores using plain C functions, so it seems like it would be a rather nice fit with Pico. Also supports Python, but not Micropython. (Yet? Micropython on one core talking with C code on the other would be really cool. π).
https://github.com/embeddedrpc/erpc
(In the interest of full disclosure, I was the original architect of eRPC, but it's been years since I've worked on it.)
GP19 always high when set as output
GP19 is immediately going high when set as output (Pin.OUT).
Setting to low (.value(0)) has no effect.
GP19 appears to function properly when set as input (Pin.IN).
All other GP pins appear to function normally.
I have 5 Pico's. All exhibit the same behavior.
I'm using pico_micropython_20210121.uf2
Enter programming mode via gpio and not only bootsel button
Hello,
As the title suggests, this will give the option of programming the pico via a remote RaspberryPi. For 1-2 units you could piggy back on the button, but I was thinking Industrial applications and many units.
Ty
RP2040 Datasheet: Wrong code example under Dormant section
In the RP2040 datasheet (build-date: 2021-01-21, build-version: fcd04ef-clean) there is an incorrect code example for section "2.11.5.2. Dormant".
Instead of referring to https://github.com/raspberrypi/pico-extras/blob/master/src/rp2_common/pico_sleep/sleep.c#L134-L155 it refers to https://github.com/raspberrypi/pico-extras/blob/master/src/rp2_common/pico_sleep/sleep.c#L106-L122.
Document MicroPython `@asm_pio` syntax explicitly
Originally raised on Discord. There is generally a 1:1 relationship between the syntax inside @asm_pio
decorators in MicroPython, and the instructions listed in the datasheet, but there are some wrinkles like the use of in_()
for in
instructions due to this being a reserved keyword in Python.
I think we need to expand the MP PIO docs to call out the syntax explicitly (now that it is stable) and generally provide more non-code-example docs of the PIO API.
Erroneous command in getting started guide
In the Getting started with Raspberry Pi Pico guide, section 6.3 "Debugging a project" at page 23, it is stated that one should copy ide/vscode/launch-raspberrypi-swd.json
to .vscode/settings.json
. Instead, ide/vscode/settings.json
should be copied to .vscode/settings.json
. Accordingly, the last line on the terminal prompt should be replaced with:
$ cp ide/vscode/settings.json .vscode/settings.json
Apart this minor nitpick, great job on the documentation!
Recommended terminal software for Mac is expensive
In the documentation for Pico, the recommended terminal software for a Mac is Serial. I hear that this package is very good, but it's also expensive. Cheaper or free open source alternatives should be noted.
2 DMA pacing timers are missing from headers and register listings
Source code only has two pacing timers.
Raspberry Pi Pico Python SDK rshell port given as dev/serial0 not /dev/ttyACM0
Raspberry Pi Pico Python SDK v1.1 Section 4.2 Using rshell
The string to start rshell is given as:
' rshell --buffer-size=512 -p /dev/serial0'
which I believe should be:
'rshell --buffer-size=512 -p /dev/ttyACM0'
The first method does not work for me, the second does.
Install Pico SDK by default on Raspberry Pi OS
It would be great if the Pico SDK could be pre-installed and pre-compiled on Raspberry Pi OS + desktop and recommended software images to avoid having to spend an hour watching it compile and install all the dependencies in front of me.
Typo in 'Getting started'
Getting started with Raspberry Pi Pico, page 59, in
src/openocd -f interface/picobrobe.cfg -f target/rp2040.cfg -s tcl
it should be picoprobe
instead of picobrobe
βοΈβοΈβοΈπππ snowy circuitpython evening βοΈβοΈβοΈποΈποΈποΈ
oh, the weather outside is frightful
but circuitpython is so delightful
and since we've no place to go
let it snow, let it snow, let it snow
here's a blink sketch for an LED connected to a RP2040 chip. release files for feather/pico/minimum board are available at https://github.com/raspberrypi/circuitpython/releases/tag/cp-pico-20201216
import time
import board
from digitalio import DigitalInOut, Direction
led = DigitalInOut(board.D13)
led.direction = Direction.OUTPUT
while True:
led.value = not led.value
time.sleep(0.25)
missing step in installing openocd on windows
On Page 55 of the Getting Started with Pico guide, the steps are:
$ cd ~/pico
$ git clone https://github.com/raspberrypi/openocd.git --branch picoprobe --depth=1
$ cd openocd
$ ./bootstrap
However, we haven't made ~/pico yet. It could either change to add the line:
$ mkdir ~/pico
or just cd to the home directory since the following steps create their own sub directories anyway.
pico-setup.sh should not install new cmake that does not meet 3.12 requirement, when installed version suffices
Happened on Intel Ubuntu 18, see:
https://www.raspberrypi.org/forums/viewtopic.php?f=145&t=300333&p=1804853#p1804853
RasPi Pico Feather Turtles....python power!
i loved computer class in grade school. i would spend the entire time programming cool shapes in apple ii logo. now i get to do the same thing using turtle in circuitpython, all im missing is chocolate milk in a carton and getting picked last for dodgeball.
benzene.mov
import time
import board
import busio
import displayio
import adafruit_ili9341
from adafruit_turtle import turtle, Color
# Release any resources currently in use for the displays
displayio.release_displays()
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
tft_cs = board.D9
tft_dc = board.D10
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D6)
display = adafruit_ili9341.ILI9341(display_bus, width=320, height=240)
turtle = turtle(display)
benzsize = min(display.width, display.height) * 0.5
print("Turtle time! Lets draw a rainbow benzene")
colors = (Color.RED, Color.ORANGE, Color.YELLOW, Color.GREEN, Color.BLUE, Color.PURPLE)
turtle.pendown()
start = turtle.pos()
for x in range(benzsize):
turtle.pencolor(colors[x % 6])
turtle.forward(x)
turtle.left(59)
while True:
pass
hilbert.mov
import time
import board
import busio
import displayio
import adafruit_ili9341
from adafruit_turtle import turtle, Color
# Release any resources currently in use for the displays
displayio.release_displays()
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
tft_cs = board.D9
tft_dc = board.D10
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D6)
display = adafruit_ili9341.ILI9341(display_bus, width=320, height=240)
turtle = turtle(display)
def hilbert2(step, rule, angle, depth, t):
if depth > 0:
a = lambda: hilbert2(step, "a", angle, depth - 1, t)
b = lambda: hilbert2(step, "b", angle, depth - 1, t)
left = lambda: t.left(angle)
right = lambda: t.right(angle)
forward = lambda: t.forward(step)
if rule == "a":
left()
b()
forward()
right()
a()
forward()
a()
right()
forward()
b()
left()
if rule == "b":
right()
a()
forward()
left()
b()
forward()
b()
left()
forward()
a()
right()
turtle.penup()
turtle.setheading(90)
turtle.goto(-80, -80)
turtle.pendown()
hilbert2(5, "a", 90, 5, turtle)
while True:
pass
tri.mov
import time
import board
import busio
import displayio
import adafruit_ili9341
from adafruit_turtle import turtle, Color
# Release any resources currently in use for the displays
displayio.release_displays()
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
tft_cs = board.D9
tft_dc = board.D10
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D6)
display = adafruit_ili9341.ILI9341(display_bus, width=320, height=240)
turtle = turtle(display)
def getMid(p1, p2):
return ((p1[0] + p2[0]) / 2, (p1[1] + p2[1]) / 2) # find midpoint
def triangle(points, depth):
turtle.penup()
turtle.goto(points[0][0], points[0][1])
turtle.pendown()
turtle.goto(points[1][0], points[1][1])
turtle.goto(points[2][0], points[2][1])
turtle.goto(points[0][0], points[0][1])
if depth > 0:
triangle(
[points[0], getMid(points[0], points[1]), getMid(points[0], points[2])],
depth - 1,
)
triangle(
[points[1], getMid(points[0], points[1]), getMid(points[1], points[2])],
depth - 1,
)
triangle(
[points[2], getMid(points[2], points[1]), getMid(points[0], points[2])],
depth - 1,
)
big = min(display.width / 2, display.height / 2)
little = big / 1.4
seed_points = [[-big, -little], [0, big], [big, -little]] # size of triangle
triangle(seed_points, 4)
while True:
pass
and of course..... (merry) christmas trees!
tree.mov
import time
import random
import board
import busio
import displayio
import adafruit_ili9341
from adafruit_turtle import turtle, Color
# Release any resources currently in use for the displays
displayio.release_displays()
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
tft_cs = board.D9
tft_dc = board.D10
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D6)
display = adafruit_ili9341.ILI9341(display_bus, width=320, height=240)
turtle = turtle(display)
# Fractal Christmas Tree:
# https://codegolf.stackexchange.com/questions/15860/make-a-scalable-christmas-tree
# by Keith Randall
n = 50 # input value for scaling the tree. note: ornaments don't scale
turtle.goto(20, 0)
#star
turtle.left(90)
turtle.forward(3*n)
turtle.pencolor(Color.YELLOW)
turtle.left(126)
turtle.pendown()
for _ in range(5):
turtle.forward(n/5)
turtle.right(144)
turtle.forward(n/5)
turtle.left(72)
turtle.right(126)
#tree
turtle.pencolor(Color.GREEN)
turtle.back(n*4.8)
def tree(d,s):
if d <= 0:
return
turtle.forward(s)
tree(d-1, s*.8)
turtle.right(120)
tree(d-3, s*.5)
turtle.right(120)
tree(d-3, s*.5)
turtle.right(120)
turtle.back(s)
turtle.pendown()
turtle.pencolor(Color.GREEN)
tree(15, n)
turtle.back(n/2)
#ornaments
def ornament(x, y):
turtle.penup()
turtle.goto(x, y)
turtle.pencolor(random.choice((Color.RED, Color.YELLOW, Color.BLUE, Color.PINK)))
turtle.pendown()
turtle.dot(12)
turtle.penup()
orn_pnts=[ (5, 60), (-7, 40), (10, 20), (-15, 0), (25, -20),
(-27, -30), (7, -33), (40, -60), (-9, -63),
(-50, -88), (62, -97) ]
for j in range(len(orn_pnts)):
ornament(-orn_pnts[j][1], orn_pnts[j][0])
turtle.penup()
turtle.goto(0, -120)
while True:
pass
Document maximum SPI speed
It's not quite clear what the maximum SPI rate is, the datasheet contains a rather confusing sentence
To generate a maximum bit rate of 1.8432Mbps in the master mode
but it sounds more like an example rather than the real limit. Also it's not quite clear what PCLK
is supposed to be, probably clk_peri
but why is the nomenclature different throughout the datasheet? That makes it hard to find the corresponding registers.
Document electrical limits
Usually MCUs have maximum sinking/sourcing capabilities per pin/per port (or group) and in total, however I can't find any such information in the datasheet.
Micropython rshell section would benefit from at least one example
For people not using Thonny, rshell is a necessity for copying the .py file to the RP2040. The current documentation shows how to invoke rshell, but then refers the read to the project documentation, which unfortunately uses /flash rather than /pyboard in most of its examples. A single example of how to install a python program using rshell would be helpful.
Micropython SDK documetation omission.
Following this forum post https://www.raspberrypi.org/forums/viewtopic.php?f=146&t=301081 ....
There doesn't seem to be any explanation in https://datasheets.raspberrypi.org/pico/raspberry-pi-pico-python-sdk.pdf
that the PIO instruction "in" has to be written as "in_" . It is only shown in passing as part of the SPI example.
RP2040 datasheet issue table 164, page 143
RP2040 DS error report:
https://datasheets.raspberrypi.org/rp2040/rp2040_datasheet.pdf
Bottom table 164 @ page 143; has addr 0x20000000 twice, the second should say 0x20000010 in my opinion.
Minor Typo in Raspberry Pi Pico C/C++ SDK
In Section 2.5.2. Return Codes and Error Handling
Additionally most of the calls to
assert
are disabled by default for code/size performance (even in debug buidls [sic]);
Should be
Additionally most of the calls to
assert
are disabled by default for code/size performance (even in debug builds);
CLUE 2040 xmas morning edition ...
we were noodling around in cad this morning, now that we have i2c and spi tip-top working in circuitpython, maybe a 'bit-shaped rp2040 board would be fun addition! we ripped the nrf52840 out of our clue design (https://adafruit.com/clue) and popped in an rp2040 instead. you get just about every sensor, a 1.3" 240x240 tft, buzzer, microphone, and a micro:bit compatible connector. we added uart-based bt support to circuitpython earlier this year, so in theory we could at bt using something like the bcm43438? goal was having not separate boot button since we already have a large reset button and a/b. using some nor logic, and the tft reset supervisor, if both buttons are held down during power up, the cs pin will be held low for 200ms which is the apx803's reset pulse width. will it work? we'll find out soon :)
here's some renderings and the schematic.
one of the ideas is that this would allow a lot of folks to use micro:bit accessories (they're doing that a lot now with the clue version we released).
oh, there's one rendering error on the board, see if you can find it!
ADC DMA sample / documentation
It would be nice to have some additional information on how to use ADC with DMA. The current documentation feels a little bit light (not clear how to setup the DMA transfer)
Use case is to build a solution with a high sampling rate for the ADC, utilizing the scenario described under "4.9.3.5. DMA" in the RP2040 Datasheet.
Thanks Michael
Typographic formatting issues in RP2040 Datasheet
build-date: 2021-01-21 build-version: fcd04ef-cl2.ean
Avoid breaking tables that would fit on one page over two. Examples:
1.4.2 Pin Descriptions
1.4.3. GPIO Functions
(Those are right after each other, with a little text before GPIO functions, so the latter may not be so easy. Table 2 also relates to Table 3.)
2.1.1.2. Bus Performance Counters
2.1.5. List of Registers
2.2.1. Summary
2.19.2. Function Select table 289 (please just put a page break before heading 2.19.)
Avoid breaking headings from the contents of their section. Examples:
1.1. Why is the chip called RP2040?
1.4.1. Pin Locations
2.1.5. List of Registers
2.2.1. Summary
SIO: DIV_REMAINDER Register page 48-49
SIO: INTERP1_BASE1 Register page 53-54
SIO: INTERP1_PEEK_FULL Register page 54-55
Actually, just put a style sheet rule in that level 2 headings can't start on the bottom third of a page unless they fit in that page, like 1.2. This would help layout of 1.1, 1.3, 1.4, 2.5, 2.8, 2.15, 2.4 (an egregious example of split table!) etc.
Never put a heading on the bottom of a page, like 4.1.2.
Avoid splitting small sections, like most of the register descriptions. These frequently have a table which would make far more sense together with the three preceding chunks (heading, offset, description).
Terrible example: SIE_STATUS register, table is so long it has to be split, but that's no excuse for putting all the non-table text on an earlier page - including the table legend in the left margin! That table descriptor should probably be on every page holding the table, certainly not on none!
RP2040 Datasheet - Page 179 - Figure 20 - Capacitor Unit
Link to datasheet: https://datasheets.raspberrypi.org/rp2040/rp2040_datasheet.pdf
I noticed a slight typo in the voltage regulator application circuit figure. The capacitor connected to the bottom DVDD pin has a unit of "Β΅nF". I believe this should be just "nF".
C/C++ SDK Documentation Typo
Under 2.7.1. Standard Input/Output (stdio) Support (Page 20)
It says:
A UART interface specified by a board configuration header. The default for Raspberry Pi Pico is 115200 baud on GPIO0 (TX) and GPIO1 (TX)
Im fairly certain that should be:
A UART interface specified by a board configuration header. The default for Raspberry Pi Pico is 115200 baud on GPIO0 (TX) and GPIO1 (RX)
π₯π₯π₯ happy new year! πΎπΎπΎ
its a fresh new year ... and here's a fresh new board we brought up today to celebrate, an itsybitsy 2040. you can see it here next to it's big-sister-feather. no battery charger or swd connector on this one, but still has quite a few pins including one that is level shifted up to 5V. i have to revise this one to skip pin 15, add silkscreen, and sort out the gpio consecutively for better pio'ing. may also make it castellated while im at it
itsy.mov
Merry Xmas Cheerlights IoT Lights Demo
Testing out SPI means trying to have 2 devices on one SPI port, plus a bunch of LEDs on a secondary port. Seems to work just fine tho :) We use an ESP32 over SPI for internet access, with requests
and json
support its easy to get any sort of internet data like CheerLights & share the holiday cheer!
cheerlights.mov
import time
import random
import board
import busio
from digitalio import DigitalInOut
# display
import displayio
import adafruit_ili9341
from adafruit_display_text import label
from adafruit_bitmap_font import bitmap_font
# wifi support
from adafruit_esp32spi import adafruit_esp32spi
from adafruit_esp32spi import adafruit_esp32spi_wifimanager
import adafruit_esp32spi.adafruit_esp32spi_socket as socket
import adafruit_requests as requests
# colorful lights
import adafruit_dotstar as dotstar
from adafruit_led_animation.animation.comet import Comet
from adafruit_led_animation.animation.sparkle import Sparkle
from adafruit_led_animation.animation.chase import Chase
from adafruit_led_animation.animation.blink import Blink
from adafruit_led_animation.animation.pulse import Pulse
from adafruit_led_animation.sequence import AnimationSequence
# Get wifi details and more from a secrets.py file
try:
from secrets import secrets
except ImportError:
print("WiFi secrets are kept in secrets.py, please add them there!")
raise
DATA_SOURCE = "https://api.thingspeak.com/channels/1417/feeds.json?results=1"
# Release any resources currently in use for the displays
displayio.release_displays()
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
tft_cs = board.D9
tft_dc = board.D10
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D6)
display = adafruit_ili9341.ILI9341(display_bus, width=320, height=240)
pixels = dotstar.DotStar(board.A0, board.A1, 144, brightness=0.2)
pixels.fill(0)
esp32_cs = DigitalInOut(board.D13)
esp32_ready = DigitalInOut(board.D11)
esp32_reset = DigitalInOut(board.D12)
esp = adafruit_esp32spi.ESP_SPIcontrol(spi, esp32_cs, esp32_ready, esp32_reset)
requests.set_socket(socket, esp)
# Make the display context
splash = displayio.Group()
# Draw a black background
color_bitmap = displayio.Bitmap(320, 240, 1)
color_palette = displayio.Palette(1)
color_palette[0] = 0x000000
bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0)
splash.append(bg_sprite)
# Draw a label
font = bitmap_font.load_font("Quicksand-Bold-48.pcf")
text_area = label.Label(font, max_glyphs=100,
anchor_point=(0, 0.5),
line_spacing=0.75,
x=20, y=120, color=0xFFFF00)
splash.append(text_area)
display.show(splash)
wifi = adafruit_esp32spi_wifimanager.ESPSPI_WiFiManager(esp, secrets, None)
# we'll save the value in question
last_value = value = None
while True:
try:
print("Fetching json from", DATA_SOURCE)
splash.hidden = True
text_area.color = 0xFFFFFF
text_area.text = "Connecting\nto\nThingSpeak"
splash.hidden = False
response = wifi.get(DATA_SOURCE)
print(response.json())
value = response.json()
color = value["feeds"][0]["field2"]
name = value["feeds"][0]["field1"]
response.close()
response = None
except (ValueError, RuntimeError) as e:
print("Failed to get data, retrying\n", e)
wifi.reset()
continue
color = int(color[1:], 16)
splash.hidden = True
text_area.color = color
text_area.text = "Cheerlights\nis "+name
splash.hidden = False
animations = AnimationSequence(
Pulse(pixels, speed=0, color=color, period=3),
Chase(pixels, speed=0, size=3, color=color, spacing=2),
Sparkle(pixels, speed=0, color=color, num_sparkles=1),
Comet(pixels, 0, color=color, tail_length=24),
advance_interval=5, auto_clear=True,
)
# animate for 3 minutes before we retry
timestamp = time.monotonic()
while (time.monotonic()-timestamp) < 180:
animations.animate()
Swap "digits" and "bytes"
Pg. 119, hexadecimal balloon... "each digit contains two bytes..." should be "each byte contains two digits...".
Use more legible fonts for datasheet
The font used for most text in the rp2040 datasheet (Hmm. And other pico-related documents as well) is very thinly stroked (or something), and difficult to read.
I've attached a screenshot showing the 2040 datasheet next to a similarly scaled output from the RPi 4 datasheet, and a similar screenshot comparing it with a microchip datasheet, both of which are much more legible.
(perhaps I am just getting old.)
Debugging Pico with ST-Link
Hi,
Is there a possibility to debug code on Pico with ST-LINK/V2 probe? If yes, is there any instruction how to connect it via VS Code on MS Windows?
Errors in pico-setup.sh
In https://www.raspberrypi.org/documentation/pico/getting-started/ under the C/C++ tab, section "SDK setup", there's a button "Download Setup Script". I did that, ran the script and got errors on lines 29 and 35 ([[ not found) and 72 (Bad substitution). I don't know what (if anything) that breaks, but it probably needs fixing.
PyOCD support
FYI Adding support is being discussed here: pyocd/pyOCD#1062
Avoid pico-setup.sh running out of space
This might not be easy depending on which of the packages to be installed are already installed or not. But I did run multiple times into out of space, before I freed 1GB and then setup did complete successfully. So when pico-setup.sh starts, and it could determine that it will run out of space at start, that will avoid minutes of waiting and running out of space then.
USB: BUFF_STATUS register is readonly in the datasheet, but readwrite in the SDK
The BUFF_STATUS
register is marked as readonly in the datasheet (page 414), but as readwrite in the C SDK headerfile
src/rp2040/hardware_structs/include/hardware/structs/usb.h
.
I assume the SDK is correct, because the status bits are reset by the USB sample code.
Getting Started With Pico C/C++ PDF - Typo
I believe there is a typo in Section 4.5. See "Hello World" UART output (page 14).
Alternatively if you dragged and dropped the
hello_usb.uf2
binary, then the "Hello World" text will be directed to UART0 on pins GP0 and GP1.
The binary should be hello_serial.uf2
.
live from new york...it's saturday night feather! feather 2040
Please hurry and add FreeRTOS
Its great to have dual cores, but without an RTOS, you are keeping our hands tied.
CircuitPython displayio makes for pretty projects
With I2C and SPI working a treat now, we've added displayio
support which allows creation of lightweight UI's without the weight of littlevgl or pillow (luv em but they're chonky). as a bonus, you also get REPL echoed onto the screen which is handy for debugging.
here's a demo showing how to make a plug-and-play environmental sensor with custom variable-width fonts.
what other demos would you like to see? :)
displayio.demo.mov
"""
This test will initialize the display using displayio and a sensor. All drawing is done
using native displayio modules.
Pinouts are for the 2.4" TFT FeatherWing
"""
import time
import board
import busio
import terminalio
import displayio
import adafruit_ili9341
import adafruit_bme680
from adafruit_display_text import label
from adafruit_bitmap_font import bitmap_font
bme680 = adafruit_bme680.Adafruit_BME680_I2C(board.I2C())
# change this to match the location's pressure (hPa) at sea level
bme680.sea_level_pressure = 1013.25
# Release any resources currently in use for the displays
displayio.release_displays()
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
tft_cs = board.D9
tft_dc = board.D10
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D6)
display = adafruit_ili9341.ILI9341(display_bus, width=320, height=240)
for x in range(3, 0, -1):
print("Starting displayio demo in %d..." % x)
time.sleep(1)
# Make the display context
splash = displayio.Group()
# Draw a black background
color_bitmap = displayio.Bitmap(320, 240, 1)
color_palette = displayio.Palette(1)
color_palette[0] = 0x000000
bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0)
splash.append(bg_sprite)
# Draw a label
font = bitmap_font.load_font("Quicksand-Bold-24.pcf")
text_area = label.Label(font, max_glyphs=100,
anchor_point=(0, 0.5),
x=20, y=120, color=0xFFFF00)
splash.append(text_area)
display.show(splash)
while True:
output = "Temperature: %0.1f C\n" % bme680.temperature
output += "Humidity: %0.1f %%\n" % bme680.relative_humidity
output += "Pressure: %0.3f hPa\n" % bme680.pressure
output += "Altitude = %0.2f meters" % bme680.altitude
print(output)
text_area.text = output
drive strength
What's the drive strength used in MicroPython?
The following isn't telling me, but I've not used this before, so I'm not sure if this isn't implemented in this port or I'm doing it wrong.
>>> import machine
>>> pin = machine.Pin(25)
>>> pin.drive()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'Pin' object has no attribute 'drive'
>>>
Suggestion: Include a simple PIO read example in the C/C++ documentation
I've been getting into PIO as I want to do some reading of data. After following the Chapter 3 documentation, I found it a leap in understanding from the output focused hello_pio
and ws2812
to the input focused logic_analyzer
example, particularly as that focused on DMA.
As such, I would like to suggest that a simple example be included that is similar to hello_pio but for reading a pin (also more input examples in general, but that's a side issue).
I wrote this as a test that seems to work (but verify yourselves):
.program reader
loop:
in pins, 1
push
jmp loop
% c-sdk {
static inline void reader_program_init(PIO pio, uint sm, uint offset, uint pin) {
pio_sm_config c = reader_program_get_default_config(offset);
sm_config_set_in_pins(&c, pin);
pio_gpio_init(pio, pin);
pio_sm_set_consecutive_pindirs(pio, sm, pin, 1, 0);
pio_sm_init(pio, sm, offset, &c);
pio_sm_set_enabled(pio, sm, true);
}
%}
This would then show that the setup is common to both examples
uint sm = pio_claim_unused_sm(pio, true);
reader_program_init(pio, sm, offset, PIN);
And that to get data out of the SM you call pio_sm_get(pio, sm);
. Could maybe have it toggle the onboard LED based on the pin state. Note, I haven't included anything about pull-up in that, as I am yet to look up what sm specific function to call.
Thanks
Another minor typo in the C/C++ Documentation
Under 3.2.1.3. CMake File (Page 33)
pico_generate_pio_header(): Declare that we have a PIO program, hello.pio, which we want to be built into a C header for use with out program
should probably be
pico_generate_pio_header(): Declare that we have a PIO program, hello.pio, which we want to be built into a C header for use with our program
Typo - Getting started... p51: pip3 install -U cmsus-svd
getting-started-with-pico.pdf
Release 1.1
build-date: 2021-01-26
build-version: b4f84f3-dirty
Page 51
9.3.1. Using openocd-svd
$ pip3 install -U cmsus-svd
should be
$ pip3 install -U cmsis-svd
Getting started: page 19
In s5.4 (Use GDB ..., page 19) of the Getting started with Raspberry Pi Pico, it states:
cd ~/pico/pico-examples/build/hello_world
I think that should be
cd ~/pico/pico-examples/build/hello_world/serial
Getting started with Pico pdf - Windows setup general observations
I'm a macOS / Ubuntu / Raspberry Pi OS user normally but have clients with Windows machines so after some comments on the forum (various places) I've tried out the Windows install so I can pre-empt any support requests. Here are some notes:
- 8.2.1 - not obvious these are links - perhaps add "download"
- 8.2.1.3 - as I discovered, you can't save 3Gb of disk space by turning off "Windows 10 SDK" - note saying you need to install as is, don't try to save space.
- 8.2.1.5 - Installing Git is being hit with a rubber mallet of options - a check list / bullet points to make the requirements easier to read would be good.
- 8.2.2 - Install in to Downloads? This looks wrong, mostly because it is. Perhaps install in to a sub folder of Documents as an example but point out that you can put it anywhere you like.
- 8.2.2 - the GitHub addresses are clickable - we need to be able to copy & paste them - please remove the click, it gets in the way.
- 8.2.3 - setting the path relative means people will be tripped up if they don't create all their projects in a directory next to the SDK folder. Perhaps using the install folder from 8.2.2 you use a hard coded path? Or highlight the relative folder issue.
- 8.2.3 - tell them to get a cup of xxxx whilst it compiles - the first two compiles of the exe's make you think 100% is quick, not so much on the examples ;-)
- 8.2.4 - The blue Visual Studio Code is a link to downloads - indicate that
- 8.2.4 - Despite the warning, people have been tripped up with running code from the Developer Command prompt - this is so important the warning should be before and after the command prompt example.
and then the well known CMake Tools -> CMake Generator -> change this to NMake Makefiles.
Preinstall uPython UF2
Not a big thing, but it would be an easier intro to new users if they could install Thonny and go straight into REPL and USB upload of code right from the start.
That might also remove possible confusion about the need to press BOOTSEL to load code.
Cannot set 'gdbpath' in launch.json in vscode
Maybe this varies between vscode versions, I'm running 1.52.1 and setting 'gdbpath' in launch.json doesn't work as asked for in 6.3 in the 'Getting Started with Raspberry Pi Pico' C/C++ guide. If you attempt to launch a debug run it complains it can't find 'arm-none-eabi-gdb' and viewing the launch.json file in vscode reports 'Property gdbpath not allowed'.
gdbpath can be set globally, by going to File -> Preferences -> Extensions -> Cortex-Debug Config -> Gdb Path -> Edit in settings.json, setting to 'gdb-multiarch' allows things to work.
its cute
the qt py board we have is a cutie pie
https://www.adafruit.com/product/4600
lets make a version that's a qt pico! double sided to fit everything, but its 7/7 and 0603 parts so very manufacture.
here's renders, castellated pads didnt show up, but it basically looks just like the above
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.