hzeller / rpi-rgb-led-matrix

Controlling up to three chains of 64x64, 32x32, 16x32 or similar RGB LED displays using Raspberry Pi GPIO
GNU General Public License v2.0
3.67k stars 1.17k forks source link

Provide a way to power the matrix off temporarily #1047

Open amantalion opened 4 years ago

amantalion commented 4 years ago

Hi,

Please could you tell me shat is the proper way to power the matrix temporarily off? I found this code in the RGBMatrix for doing that:

if (updater_) {
    updater_->Stop();
    updater_->WaitStopped();
}
delete updater_;

// Make sure LEDs are off.
active_->Clear();
if (io_) active_->framebuffer()->DumpToMatrix(io_, 0);

Then, to power the matrix back on I would use:

matrix->StartRefresh();
matrix->SwapOnVSync(&frameCanvas);

Is that correct? If so, then shall I create a pull request to add the function for powering the matrix off?

Thank you!

hzeller commented 4 years ago

Is there a particular reason you'd like to do that ?

jeremywww commented 3 years ago

To stop the CPU usage when the display would otherwise be blank for an extended period of time.