Pico Micropython Image

I had another PICO delivered yesterday, to put CircuitPython on… There were some in stock on Friday. Can only get one at a time so post & packing @ £2.50, is a significant add-on.
Not sure if there are any Pico drivers for breakout boards in the Pimoroni UF2 file and am unsure how to install them from elsewhere. MicroPython is not as friendly as CircuitPython, where you can see all the files on a device. There are two Breakout ports on the Explorer and the screen is really useful at 240 x 240 pixels.

I’ve just added an Instructable here:
Raspberry Pi Pico & Pico Explorer Workout : 15 Steps - Instructables It is a more extensive demo of the graphic capabilities of the screen and includes routines to draw lines, hollow rectangles and circles, plot line and bar graphs, scroll text on a pre-defined path and create and display your own characters - lower case or ducks in a row?

I hope it is of some help and encouragement.

The Explorer is a really fun board and the Pico great new toy.

Chris Swift
No lower case characters.
If you delve into the UF2 folder to the font part you will find that the lower case letters are the same as the uppercase letters. (Not saving space.) If we want lower case we just have to change these 26 lines for our own design.
{0x3c,0x12,0x12,0x12,0x3e,0x00}, // A
{0x3c,0x2a,0x2a,0x2e,0x10,0x00}, // B
{0x1c,0x22,0x22,0x22,0x00,0x00}, // C
{0x3c,0x12,0x12,0x12,0x3e,0x00}, // a
{0x3c,0x2a,0x2a,0x2e,0x10,0x00}, // b
{0x1c,0x22,0x22,0x22,0x00,0x00}, // c

Just placed my order for
• 1x Pico Display Pack for £11.25 each
• 1x Pico Omnibus (Dual Expander) for £6.25 each
• 1x Raspberry Pi Pico for £3.00 each

Other things I wanted were either out of stock or coming soon.

That’s pretty much exactly what I got and I’ve been having fun with it. I’m tempted to order a Pico Proto and use it to wire up some Breakout Garden Extenders. I know Pimoroni will probably make a small BG Pack, but with stuff which is listed on the store being out of stock I’d guess unlisted products are even further away, so I might DIY it in the meantime.

I almost ordered some of the Breakout garden extenders. Was thinking I could just plug them into a solderless breadboard and save from having to solder headers on the breakouts. I have a couple of breakouts with headers on them already so I didn’t bother. Plus no SPI extenders, only i2c.

The Pico Explorer has two breakout ports built in and ready for I2C. It also has breakout sockets for I2C and SPI. I know how to add/remove libraries in CircuitPython - super easy as you can see what is going on and there are many of them. Where do you find a MicroPython library for, say a BME280 or an SSD1306, and add them to the Pico so they can be called.
I feel this should have been covered in the Raspberry Pi Pico book - more important than PIOs as we start out.

I was looking at the explorer, I likely would have ordered one if it had been in stock. That or the Breakout Garden one, which is still coming soon.
I have a decent sized solderless breadboard I can get by with so not a big deal. My order hasn’t shipped yet and I went International Standard (snail mail) so it will be a couple of weeks before I get to play with it.

Exactly, I’d happily buy an Explorer base but new stock seems to be a bit slow to arrive.

@Tonygo2, this seems to be one of the major drawbacks of MicroPython versus CircuitPython. It seems that with Micropython libraries have to be baked-in to the .uf2 firmware file, or added file-by-file via Thonny. In CircuitPython the filesystem is exposed in the removable drive and you can copy and paste directories of files over directly.

I far prefer the CircuitPython approach, and I really hope MicroPython adopts that at some point.

Get an Explorer for the screen it’s magic. It will be worth the wait.
I’d better ‘nuke’ my Pico and put CircuitPython on it.

I put CircuitPython on a Pico.
Worked a treat. Button switch, LED with PWM from potentiometer (just as in accurate) all easy to set up. Connect an I2C output device - SSD1306 128x64 and quickly got it working.

Until they sort out library problem with MicroPython it appears to be the only way - unfortunate.

@Tonygo2 I was looking through the Pico Datasheet, and section 4.3 talks about the ADC. It says:

The ADC draws current (about 150μA if the temperature sense diode is disabled, but it varies from chip to chip) and therefore there will be an inherent offset of about 150μA*200 = ~30mV. There is a small difference in current draw when the ADC is sampling (about +20μA) so that offset will also vary with sampling as well as operating temperature.

Presumably that offset is why the ADC doesn’t ever hit 0.

Yup, MicroPython seems a bit behind CircuitPython right now. Fingers crossed they intend to fix that.

It tried tying unused ADC pins to GND - did not help. I think they need u16 numbers for easy PWM - Read the ADC and pop into PWM duty. I tried that but at the top end the LED kept going off unexpectedly.

I did some experiments with averaging ten ADC readings ten times and calculating the standard deviations. Conclusion: Who really needs more than 0 - 255 most of the time. The 0 more important than the 255 most of the time.

Unused ADC pins to GND – Potentiometer near centre

Divisor: 1 Highest: 65535

Mean: 33961 33940 33966 33920 33961 33947 33974 33913 33936 33966

SD: 86 101 76 115 88 107 131 88 77 97

Average Mean: 33948

Average SD: 96

Divisor: 2 Highest: 32767

Mean: 16954 16979 16966 16961 16942 16936 16985 16970 16962 16971

SD: 37 49 47 31 44 17 41 59 50 40

Average Mean: 16962

Average SD: 41

Divisor: 256 Highest: 255

Mean: 132 132 132 132 132 132 132 132 132 132

SD: 0 0 0 0 0 0 0 0 0 0

Average Mean: 132

Average SD: 0

Unused ADC pins to GND – Potentiometer at MAXIMUM

Divisor: 256 Highest: 255

Mean: 255 255 255 255 255 255 255 255 255 255

SD: 0 0 0 0 0 0 0 0 0 0

Average Mean: 255

Average SD: 0

Unused ADC pins to GND – Potentiometer at ZERO

Divisor: 256 Highest: 255

Mean: 1 1 1 1 1 1 1 1 1 1

SD: 0 0 0 0 0 0 0 0 0 0

Average Mean: 1 ########## Problem – NOT ZERO ############

Average SD: 0

So:
Average ten raw readings
Divide by 256
Take 1 off
If neg set to zero
Scale up and adjust top if necessary
0 - 1023 always works an an Arduino!

Libraries in MicroPythons are easier than we thought.

After looking in the appendix of the Pico Python SDK and trying a few things I’ve not got my ssd1306 working in MicroPython.

You need the driver as a “ssd1306.py” in Thonny. Save it in the normal way. Then run your normal program which uses the library from Thonny.

If you want to see what you have stored on the Pico use Thonny to try to load a program from the Pico and you can see all the libraries that you have saved. If you right click a file you can then delete it.
Much easier than I thought.

I’ve also got a 1.12" 128x128 Pimoroni display mentioned in the SDK appendix. I’ll give that a go.
Just a matter of finding all the drivers in this format …

Yup, you can do it that way for individual files, but installing a bundle is a bit of a pain. You can also see (and manage the files using the OS module:

import os
os.listdir() # Prints all files in the file system

If you do that outside the REPL you need to print the output of os.listdir().

Hi
I was wondering if pimoroni ever released the pico explorer demo which is showing in the advert.

I think they used a BME680 or 280 in the break out slot.

I would love to be able to use the breakout (i have A BME680).

I’d also like to get my hands on that code. =)

I can’t see any code for a BME6/280 in the repo, or anything else which looks like the shop photo. There’s, uh, also no RTC so the board wouldn’t have had the time and date. I’d guess it’s just a mockup, but it shouldn’t be too hard to make something similar?

I found this info on the PICO’s RTC. Might be of interest.
Sync Pico RTC with host computer - Raspberry Pi Forums

This may also be of interest.
Pico with BME280 breakout (via Explorer Base and MicroPython) - Discussion / Raspberry Pi - Pimoroni Buccaneers