Skip to Content
Lumensalis CircuitPython framework coming soon 🎉

Panel Control

A Panel Control lets you add custom Inputs to a Panel inour project which provide a source of change from “outside”. Whereas most Inputs typically represent a physical component (like a button, switch, or sensor), a Panel Control represents a virtual component on a “remote control” for your project.

⚠️

A Panel Control is not a Control. While the names are similar, they are distinct concepts in the LCPF.

Examples

In your Project Definition

Say your project has two two Scenes (actOne and actTwo) and uses an audio Device (myAudioDevice)

You could add a volume control for your project like this:

volume = main.panel.addFloat(0,min=0,max=11) actOne.addRule( myAudioDevice.volume, volume ) actTwo.addRule( myAudioDevice.volume, volume / 2 ) # make scene two quieter...

What it looks like

Who knows? The whole point is that you are definining What Not How - this is what I want “remotely controllable” in my project, let the LCPF figure out how something can connect and make that happen.

There are many ways you could represent a “value from 0 to 11”.

  • It could be a slider, a dial, or just a simple number input
  • It could be on a web page. In fact the LCPF already provides a basic WebUI for your project which will let you modify all the Panel Controls in your Project Definition
  • It might be a physical input (like a knob) in another LCPF project which can connect with this one1 and “update” any of the Panel Controls.

Footnotes

  1. The ability to have different LCPF projects “connect” - specifically by accesing each other’s Panels, has not been added to the LCPF yet, but it’s on the short list and should be coming soon. ↩