Skip to content

Releases: pimoroni/plasma

Version 1.1.0

02 Mar 09:49
51a5fa5

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.0.0...v1.1.0

Version 1.0.0

31 Mar 10:59
164ee65

Choose a tag to compare

🎉 A Little Love For Plasma 🎉

This repository is the new home for Plasma boards based on the RP2 series microcontrollers. That includes Plasma 2040, Plasma Stick 2350 W, Plasma 2350 and Plasma 2350 W.

We've taken all we've learned over the past few years (has it really been years already!?) of Pico MicroPython and bundled it up to give Plasma the same care and attention our new products are getting.

This - hopefully - makes it easier to find firmware for your Plasma boards, makes it easier to find example, and - because the firmware is tailored for each board - eliminates some code drudgery. More on the latter below.

We might have broken your code along the way, sorry about that, but the changes are for the better!

Breaking Changes

Pin Constants

We've removed plasma_stick and plasma2040 modules from plasma and used MicroPython's built in support for naming pins. That means no more from plasma import plasma_stick and plasma_stick.BUTTON_A, instead you can use:

machine.Pin("BUTTON_A")

Or find pins in machine.Pin.board:

>>> help(machine.Pin.board)
object <class 'board'> is of type type
... snip ...
  BUTTON_A -- Pin(GPIO12, mode=ALT, pull=PULL_DOWN, alt=31)
  GP12 -- Pin(GPIO12, mode=ALT, pull=PULL_DOWN, alt=31)
  SW_A -- Pin(GPIO12, mode=ALT, pull=PULL_DOWN, alt=31)
  GP13 -- Pin(GPIO13, mode=ALT, pull=PULL_DOWN, alt=31)
  GP14 -- Pin(GPIO14, mode=ALT, pull=PULL_DOWN, alt=31)
  PLASMA_CLK -- Pin(GPIO14, mode=ALT, pull=PULL_DOWN, alt=31)
  PLASMA_DAT -- Pin(GPIO15, mode=ALT, pull=PULL_DOWN, alt=31)
  GP15 -- Pin(GPIO15, mode=ALT, pull=PULL_DOWN, alt=31)
  LED_R -- Pin(GPIO16, mode=ALT, pull=PULL_DOWN, alt=31)
  GP16 -- Pin(GPIO16, mode=ALT, pull=PULL_DOWN, alt=31)
  LED -- Pin(GPIO17, mode=ALT, pull=PULL_DOWN, alt=31)
  LED_G -- Pin(GPIO17, mode=ALT, pull=PULL_DOWN, alt=31)
  GP17 -- Pin(GPIO17, mode=ALT, pull=PULL_DOWN, alt=31)
  LED_B -- Pin(GPIO18, mode=ALT, pull=PULL_DOWN, alt=31)
... snip ...
  USER_SW -- Pin(GPIO22, mode=ALT, pull=PULL_DOWN, alt=31)
... snip ...

RGBLED

Since we now have pin constants and a copy of RGBLED that's exclusive to Plasma boards it made sense to fix that up too.

This:

led = RGBLED()

Is shorthand for:

led = RGBLED("LED_R", "LED_G", "LED_B")

And replaces:

led = RGBLED(plasma2040.LED_R, plasma2040.LED_G, plasma2040.LED_B)

SPI and I2C

SPI

Where there's a sensible SPI bus on a Plasma board we've set it as the default, so - thanks to some recent changes in MicroPython - you can just use machine.SPI().

I2C

Thanks to those same changes in MicroPython we've also vanquished:

i2c = PimoroniI2C(plasma2040.SDA, plasma2040.SCL)

In favour of just:

i2c = machine.I2C()

(Well, to be fair we made machine.I2C() and PimoroniI2C() (there's a reason for why the latter existed in the first place we promise) equivalent a long time ago, but our examples never got the memo.

Note: PimoroniI2C() is deprecated, you shouldn't use it!

Fixes And Improvements

Non-blocking Updates

If you want to get the most out of Plasma with asyncio or otherwise, you can skip led_strip.start() and instead call:

led_strip.set_blocking(False)

This makes led_strip.update() non-blocking, ie: it wont wait for the pixel data to be transmitted to the LEDs before returning.

You can then use is_busy() to block, like so:

while led_strip.is_busy():
    pass

This is useful because led_strip.start() runs at a fixed framerate which may or may not align with how fast your code prepares the next "frame".

⚠️ Plasma is not double-buffered, so you should not call let_strip.set_rgb() or led_strip.set_hsv() while it's busy! Keep your pixel values in a separate array and push them over in one shot.

Test Release 004

24 Mar 21:38

Choose a tag to compare

Test Release 004 Pre-release
Pre-release

Full Changelog: test-003...test-004

Test Release 003

24 Mar 20:55

Choose a tag to compare

Test Release 003 Pre-release
Pre-release

Full Changelog: test-002...test-003