Presto – Interference Between full_res Mode and Plasma Module

This question is about implementing with MicroPython.
When the screen mode is set to full_res=True and the Plasma module is used, visual noise appears on the screen. This noise seems similar to what occurs when memory access is disrupted by interrupt signals.

For example, the phenomenon can be reproduced by modifying the “examples/balls_demo.py” code as shown below:

import random

from presto import Presto

# Setup for the Presto display
#presto = Presto()
presto = Presto(full_res=True) # <=== full_res=True
# ----HERE---
import plasma
bl = plasma.WS2812 (7, 0, 0, 33)
bl.start ()
# ----HERE---

There are no methods like bl.stop() or bl.disable() to halt the Plasma module, but is there any way to stop or prevent this noise?

Thank you in advance for your advice.

Supplementary Information:
In my current project, I would like to use the rear LEDs to indicate the internal state of the app in certain situations. I don’t intend to keep them on all the time, but once the start method is called on a Plasma object instance, it seems impossible to stop it. As a result, visual noise continues to interfere with the high-resolution screen mode.

Ideally, I would like the noise to appear only when the LEDs are in use and to be able to stop Plasma when the LEDs are not needed, ensuring a noise-free high-resolution display. However, if there is no method provided to properly stop Plasma, I find this quite puzzling.

I’ve managed to solve the issue myself and found a solution.
By using start(0) and update(), I was able to control the rear LEDs while suppressing the visual noise.

import random

presto = Presto(full_res=True) # <=== full_res=True
# ----HERE---
import plasma
bl = plasma.WS2812 (7, 0, 0, 33)
bl.start (0) # <=== The "FPS" should be 0

def on ( brightness = 255 ):
    for i in range (7):
        bl.set_rgb (i, brightness, brightness, brightness)
    bl.update () # <=== Call "update" explicitly
def off () : on (0)
# ----HERE---

With Version 0.0.8, there’s no longer a need to use the Plasma module for ambient LED control, completely resolving the issues I raised in this thread.

All that’s required is to replace plasma.set_rgb() with presto.set_led_rgb(). The migration is straightforward and hassle-free.

And Previously, initialising a Plasma instance and calling start() seemed to require a large amount of temporary memory, making it necessary to experiment with gc.collect() to achieve a stable implementation. Now that the Plasma module is no longer needed, this issue is a thing of the past.

1 Like