neu-rah / ArduinoMenu

Arduino generic menu/interactivity system
GNU Lesser General Public License v2.1
948 stars 191 forks source link

Add SmartMatrix as output option #373

Closed welshcoder closed 2 years ago

welshcoder commented 2 years ago

Adds the ability to use SmartMatrix hardware as a MenuOut device. Requires the SmartMatrix library and a background layer to be set up already.

To use:

    ucgPanels=new panelsList(panels,nodes,MENU_PANELS_NUM);
    SMOut=new SmartMatrixOut<RGB_TYPE(24),kBackgroundLayerOptions>(backgroundLayer,menuColors,ucg_tops,*ucgPanels,fontChoices::font6x10,menuOut::styles::none); 
    outputs[0]=SMOut;
    out=new outputsList(outputs,1);

where RGB_TYPE is a macro defined by the SmartMatrix library, backgroundLayer is the background layer object and kBackgroundLayerOptions contains the options for the layer as defined by the SmartMatrix library. The fontChoices are those that are provided by the Smart Matrix library.

This has been working quite reliably for me for a while now, so I hope it's useful to you.

welshcoder commented 2 years ago

Just for clarification, the SmartMatrix library is available here: https://github.com/pixelmatix/SmartMatrix