Skip to content

Releases: pimoroni/pimoroni-pico

Version 1.18.9

23 May 19:12
1798ded
Compare
Choose a tag to compare
Version 1.18.9 Pre-release
Pre-release

Really Rad Refactor

⚠️ This release has some spicy changes that you might not want to be dealing with right now. If you're looking for your code to keep ticking along as usual then please grab v1.18.7. If you want to help find all the ways in which I've broken our MicroPython build... please give this release a go!

This is a bugfix and refactor release for the v1.18.8 beta.

Crucially the ST7789 combined LCD driver has seen some fixes to line and triangle which were fixed in #344 in the other libraries, but missed out here.

Additionally some significant refactoring has been applied across all of our MicroPython-wrapped-C++ classes, such that they are allocated within MicroPython's "gc_heap" memory region. This should have no real effect for most users, but fixes an issue where the RP2040 would run out of RAM when allocating classes because they were being allocated in the tiny amount of free RAM left to MicroPython's core/C/C++ code.

This led to some very smelly defensive programming where buffers that should have been constant sized and allocated as part of a class were being allocated with m_new and passed in as pointers, just to keep the class size down and avoid blowing through the memory.

You can now create 3000 instances of Pimoroni I2C with impunity. Have fun!

I also snuck the ADCFFT library into this release. It's surprisingly effective even under MicroPython!

What's Changed

Full Changelog: v1.18.8...v1.18.9

Version 1.18.8 - Beta Bonanza

18 May 13:05
db60553
Compare
Choose a tag to compare
Pre-release

Beta Bonanza

⚠️ This release has some spicy changes that you might not want to be dealing with right now. If you're looking for your code to keep ticking along as usual then please grab v1.18.7. If you want to help find all the ways in which I've broken our MicroPython build... please give this release a go!

Unified ST7789 Display Driver

We were wasting a lot of precious bytes duplicating code for our display products. Indeed Pico Display, Pico Display 2.0, 240x240 1.3" SPI LCD and the 240x240 round SPI LCD were all using the same ST7789 driver under the hood and we'd reinvented how to read a pin (Pico Display's buttons) in an effort to keep things simple and self contained.

As a consequence I have replaced all of the libraries for these display products with just ST7789 which accepts a width and height corresponding to the product you want to use. This hides the bytearray buffer wart we needed to avoid display buffers being eaten by MicroPython's GC.

This means you can now do really cool stuff like driving two Pico Display 2.0 boards from one Pico.

ST7789 discards the LED and Button functionality. With Pico Zero, MicroPython's own machine.Pin and our Button and RGBLED libraries on the scene, we really didn't need yet another way to drive RGB LEDs and buttons.

Dropping four libraries in favour of one helps slim down our batteries-included MicroPython build so we can continue to add functionality. It does- however- mean you'll need to make some changes to your code.

Code that once looked like:

import picodisplay as display

width = display.get_width()
height = display.get_height()

display_buffer = bytearray(width * height * 2)
display.init(display_buffer)

Should now look like:

import st7789

WIDTH = 240
HEIGHT = 135

display = st7789.ST7789(WIDTH, HEIGHT, rotate180=False)

And if you want a portrait display you can just swap the width/height like so:

import st7789

WIDTH = 135
HEIGHT = 240

display = st7789.ST7789(WIDTH, HEIGHT, rotate180=False)

For buttons you can use Pico Zero, or our baked-in button library. Our Button library supports auto-repeat if you need it.

Here's how to set up the Pico Display and Pico Display 2.0" buttons:

from pimoroni import Button
button_a = Button(12)
button_b = Button(13)
button_x = Button(14)
button_y = Button(15)

And the RGB LED:

from pimoroni import RGBLED
led = RGBLED(6, 7, 8)

ℹ️ The 160x80 colour LCD uses the ST7735 driver under the hood and the way you use it has not changed!

Pimoroni I2C vs machine.I2C

It's been bugging me for a while, but it wasn't until @alphanumeric007 raised #359 that it truly dawned upon me how our Pimoroni I2C object feels like a dose of not-invented-here syndrome. It's not. It exists because we needed a standard set of I2C functions for our C++ libraries, and it works well for this. However MicroPython already has a standard set of I2C functions, so wrapping our C++ libraries up for it resulted in this ugly wart of a... weird third party I2C library. There was no real reason not to sweep this under the rug as an implementation detail; so I have.

I2C has now changed in two ways:

  1. PimoroniI2C is a weird superset of machine.I2C and will work fine as a drop-in replacement if you want to keep using it
  2. machine.I2C instances will now be accepted by all of our MicroPython I2C-based sensor libraries, and quietly promoted to PimoroniI2C behind the scenes

This means that, should you wish to, you can now do this:

sda = machine.Pin(4)
scl = machine.Pin(5)
i2c = machine.I2C(0, sda=sda, scl=scl, freq=400_000)
bme280 = BreakoutBME280(i2c)

And machine.I2C and PimoroniI2C are equivalent:

>>> import pimoroni_i2c
>>> i2c = pimoroni_i2c.PimoroniI2C(4, 5)
>>> dir(i2c)
['__class__', 'readinto', 'start', 'stop', 'write', 'init', 'readfrom', 'readfrom_into', 'readfrom_mem', 'readfrom_mem_into', 'scan', 'writeto', 'writeto_mem', 'writevto']
>>> import machine
>>> i2c = machine.I2C(0, sda=machine.Pin(4), scl=machine.Pin(5))
>>> dir(i2c)
['__class__', 'readinto', 'start', 'stop', 'write', 'init', 'readfrom', 'readfrom_into', 'readfrom_mem', 'readfrom_mem_into', 'scan', 'writeto', 'writeto_mem', 'writevto']

Your existing scripts should continue to work, and you should generally continue to use PimoroniI2C since it avoids some extra overhead when used with our libraries. However you can now share one single I2C object (whichever it might be) with both Pimoroni baked-in libraries and any third-party MicroPython libraries you might want to use!

What's Changed

Full Changelog: v1.18.7...v1.18.8

Version 1.18.7

16 May 10:58
22ab2b2
Compare
Choose a tag to compare

Marvellous Motors & Exquisite Encoders

Following on from the Servo support @ZodiusInfuser added to the last release, they have now added motor support to Pico. This includes both PWM and PIO flavours, letting you drive up to 15 motors at once!

That's not all. This release also comes with PIO-based encoder support, letting you connect up to 8 quadrature rotary encoders to your projects. Use these as part of your project's interface, or to give feedback on the position and speed of your motors.

These are mostly to drive our own products, but you can use these libraries - both C++ and MicroPython-wrapped-C++ - to drive motors and read encoders connected to any RP2040 board.

Notable Fixes

  • Fixed a bug that caused SCD41 to lock up
  • Fixed breakout_roundlcd graphics primitives in MicroPython
  • Fixed line and triangle primitives for breakout LCDs
  • Badger2040: Fixed hang when calling "partial_update" in MicroPython

Known Issues

Blinka and PlatformDetect versions have been bumped and some more core files added, unfortunately our build is getting a little bloated- we've included too many batteries and there may be cases where this causes MicroPython to crash quite spectacularly and require re-flashing. (because the binary is so big it overwrites its very tippy top when the filesystem is created or written to) We're looking into this!

The Winds Of Change Are Blowin'

To try and whittle back our very chunky MicroPython build, we have a project in the works to unify all of our (ST7789-based) Display products under one driver. This includes Pico Display, Pico Display 2.0" and the 240x240 round and Square LCDs. The coded needed to drive these products will change somewhat, and we'll have a migration guide ready to help guide you.

A benefit of this change is that you can- if you're determined- use multiple displays. Watch this space, we're hoping this will find its way into the next release!

See the pending PR for more details: #327

What's Changed

New Contributors

Full Changelog: v1.18.6...v1.18.7

Version 1.18.6

01 Apr 16:11
832d0f0
Compare
Choose a tag to compare

Better Badger, Fantastic Fonts, Wonderful-WiFi, Super Servos

This release is packed with changes for Badger 2040 and general Pico builds.

Better Badger

@MichaelBell has delved to sweep up any remaining unconverted apps from 1.18.5, making everything possible super power-friendly on Badger 2040. There's also a new over/underclocking API method to help you get the most out of your batteries and slightly improved wake handling

Fantastic Fonts

I've overhauled our font rendering, pulling Hershey and Bitmap fonts into their own libraries so they're easy to combine with different drawing libraries and behave the same everywhere they are used. Bitmap fonts will now handle characters like £, ° and many accented characters gracefully. Hershey fonts are lagging behind, but will substitute some accented characters rather than breaking entirely.

The end game is to try and bring support for all the useful characters from - https://www.utf8-chartable.de/

Unfortunately characters outside of this set will get exponentially more complicated to add, and we have to strike a balance somewhere.

As a result of this overhaul, Badger 2040 now supports three bitmap fonts which are demonstrated in the updated fonts app. For now, use these for non-English languages (or even English, since we have many accented loan words), displaying prices in pounds, or temperatures in degrees C.

Wonderful WiFi

I've merged a huge changeset that overhauls every single Pico Wireless function to use a standard pattern that's much easier to work with, debug and understand. I've tried to test this as best I can, but it may still contain bugs. Let us know via issues if you have... issues... with your wireless apps.

Super Servos

@ZodiusInfuser has completed a huge project to bring incredible 18-channel PIO servo support to Pico. This is mostly to drive our own products, but you can use these libraries - both C++ and MicroPython-wrapped-C++ - to drive servos connected to any RP2040 board.

What's Changed

New Contributors

Full Changelog: v1.18.5...v1.18.6

Version 1.18.5 - Brilliantly Better Badger Battery

25 Mar 17:00
522c83d
Compare
Choose a tag to compare

👇 Scroll down to find .uf2 files under "Assets". There are now too many to manually list at the top here! 👇

What's all this about battery, then?

The super exciting battery changes in this release have been brought to you by @MichaelBell, Bishop of Badger batteries and connoseuir of coins cells.

The TLDR is that battery life in apps like QRGen, Badge and Image is now immensely improved while running from AA, AAA, LiPo or Coin-cell batteries connected to the JST connector.

How did @MichaelBell achieve this enormous improvement? By just turning Badger 2040 off. Yup, MicroPython can't use any power if it's turned completely off. While I've been worring about sleep states and pin wake interrupts Michael has swept in with a brilliantly elegant solution. I wont say simple because there's some clever stuff happening here and it's taken a lot of work to make the best use of it. But it's elegant!

Badger OS now makes liberal use of text files to save the state of various apps, including which app was launched last. When the launcher fires up, it checks its own state and launches the last known app. That app will then load its own state and handle whatever button you pressed to wake up Badger 2040, update the screen and turn off the power again.

Now when you load the Badge app, for example, it'll display the badge and cut the power to your Badger 2040. Even the launcher itself will power off, so you wont drain the battery leaving it running!

Badger OS - what's changed?

  • Exiting to the launcher is now done by pressing A + C simultaneously
  • If a launcher app has an error, or is missing, you'll see a little on-screen message!
  • There's a new badger_os module with some handy features for saving/loading app state and displaying warnings.
  • You should use .pressed() to handle buttons in Badger OS apps now.
  • If your app just shows something on screen, you can call .halt() to power off when you're done!
  • ⚠️ The USER button doesn't work so well as a shift key on battery, since your Badger will wake up in bootloader mode! You can sorta fudge it by pressing USER quickly as the Badger starts up. It works as normal on USB power.

Known issues:

  • Battery indicator mostly reads as disconnected, since it needs some time for the vref to stabalise.
  • If you delete images and have an app state saved to show an out-of-range image, you'll get an IndexError.

Other Changes

  • A nasty bug in PAA5100 / PMW3901 has been fixed, which would cause very confusing errors when trying to read data.
  • An awesome new Conway's Game Of Life example for Badger 2040.
  • Assorted minor tweaks and fixes, thank you to all who contributed these!

Full Changelog: v1.18.4...v1.18.5

Merged PRs

New Contributors

Version 1.18.4 - Board-specific Build Bonanza

11 Mar 14:09
80e4558
Compare
Choose a tag to compare

👇 Scroll down to find .uf2 files under "Assets". There are now too many to manually list at the top here! 👇

Board-specific Builds

As pointed out in #272 we weren't building versions of MicroPython for specific boards, so 4MB, 8MB and 16MB variants were getting left in the dark, with only 2MB being available.

This has now changed. You'll find multiple builds of MicroPython in this release and should use the one that corresponds to your board.

❗ Note: This isn't available for the Blinka build yet. That's a whole other can of worms! If you use this build, let us know because you can sideload the Blinka libraries and it would be really handy to drop it from our auto-builds altogether if it's not seeing much use.

Badger Bug Bashing

Bader2040 / badgerOS has had a number of fixes (detailed below) but nothing groundbreaking. Notably all the silly bugs I introduced when trying to make the clock example settable have been squashed by @lurch.

Additionally there are some fixes to the rendering of text, which should make 90, 180 and 270 degree rotations look less wonky.

QR Codes

badgerOS now includes a QR code generator: qrgen. Run it once and edit qrcode.txt via Thonny to set your own URL, title and description.

image

This same library is baked into all other MicroPython builds, and there's an example .py for Pico Display/Pico Display 2.0" to get you started.

Improvements and documentation will follow!

What's Changed

New Contributors

Full Changelog: v1.18.3...v1.18.4

Version 1.18.3 - The Badger Returns

04 Mar 17:18
3ce3477
Compare
Choose a tag to compare

Downloads

Summary

This release includes a slew of updates to the Badger 2040 examples and launcher:

  • You can now replace the built-in examples by copying the appropriate example to your Badger 2040 via Thonny. Eg: copying ebook.py will launch your copy instead of the builtin one. To restore to the builtin just delete your version from the filesystem.
  • The eBook reader now supports multiple font sizes and styles. Press A or B to change size or style.
  • The eBook reader now uses "book.txt"
  • The image viewer now supports hiding the UI. Press A to toggle it on and off.
  • The clock example can now have the time changed, press B to toggle time set mode and use A/B/UP/DOWN to navigate.
  • Badge has been fixed to correctly read a custom image.
  • Checklist/list now saves checklist.txt to disk and will update it when you check off an item!
  • Fixed a bug hiding in the launcher that caused it to crash after running a file.

Regular (non-badger) MicroPython builds no longer include the Badger2040 module (it's a bit redundant and very chonky) but are otherwise the same as v1.18.2.

What's Changed

Full Changelog: 1.18.2...v1.18.3

New Contributors

Supported Breakouts

Version 1.18.2 - Badger Edition

25 Feb 16:28
273ca5c
Compare
Choose a tag to compare

Downloads

Summary

This release should finally fix the display memory corruption bugs. Sorry it took us so long, it was a tricky one despite the eventual fix being so simple (and staring us in the face).

This release also adds support for Badger 2040, complete with its own build of MicroPython preloaded with a launcher and some tasty examples.

Otherwise the Python builds are the same as v1.18.1.

What's Changed

Full Changelog: v1.18.1...1.18.2

Supported Breakouts

Version 1.18.1

10 Feb 18:16
9fafa3e
Compare
Choose a tag to compare

Downloads

Summary

This releases fixes an issue with I2C for the ICP10125 sensor. Otherwise the Python builds are the same as v1.18.0.

What's Changed

Full Changelog: v1.18.0...v1.18.1

New Contributors

Supported Breakouts

Version 1.18.0

27 Jan 13:18
91b3ffb
Compare
Choose a tag to compare

Downloads

Summary

This release has the same libraries/modules as v0.3.3 (https://github.com/pimoroni/pimoroni-pico/releases/tag/v0.3.3) however:

Changes

  • Clarify BME68X humidity and gas resistance units by @SamStudio8 in #241
  • SCD41: Add i2c pins to MicroPython example by @Gadgetoid in #242
  • Bump MicroPython to v1.18 by @Gadgetoid in #240
  • Various minor documentation tweaks and improvements have been swept along for the ride

New Version Number Format

We were previously stepping through incremental minor and patch numbers. In an effort to better reflect the dependence upon upstream MicroPython, the Major and Minor (1.18) version numbers now reflect the MicroPython release version.

The Patch version will continue to reflect incremental changes to the library, including bugfixes, newly supported device and so on.

New Contributors

Full Changelog: v0.3.3...v1.18.0

Supported Breakouts