Potentiomrter controling LUM of 3 leds with buttons

How can I control 3 LEDs with 3 buttons and I can … when I press the button (1) i control the LUM with the pot on the LED (1) … when I press the button (2) i control the LUM with the pot on the LED (2) press the button (3) to control the Led (3) LUM with the pot …
Thanks for all the tips

Since you want to use one POT to control 3 LEDs at different levels, you need to remember the last value set for each LED, so LUM for each LED should be linked to a buffer output pin.

The buffer will only update when it receives a pulse, so you have two options:

  1. Push a button to transfer current POT setting to appropriate LED. LED setting only changes when you push a button. Button will feed directly to buffer-UPD pin.
  2. Use flip-flops to remember which button was pushed and use flip-flop output to tell buffer to continuously update based on POT setting.

For the 2nd option, we have a problem. Buffer will only update on a pulse, but flip-flop only pulses when it switches to true, so the buffer will not continuously update as you change POT after pushing button. One way around this would be to insert a clock node between the flip-flop & the buffer to generate pulses as long as flip-flop is true (tied to clock-EN pin). clock-IVAL can be made small enough to make it look like updates are continuous.

Another option instead of using clock nodes would be to create a buffer-enable node that has an enable pin instead of an UPD pin. buffer-enable would be much more efficient since it can be fed directly by flip-flop and doesn’t require Arduino timers for the clock nodes to generate pulses, but it requires generating a new node with C++ code. The code for the buffer node is pretty trivial, so starting with it and finding sample code from another node with an enable pin (or any sample with a boolean input pin) would make creating this node pretty easy.

1 Like

Thank for nice tip @gweimer

Here’s how I did it:

The patch:

That’s exactly the gate node :wink:

Nice thanks I try it

What is the board that uses it.

It’s a so-called Troyka Modules which is for now available in Russia only. Basically all modules are “small shields” and you can put up to six onto a single standard-sized Arduino. Very handy to build quick prototypes like this.

They will be available in EU in USA latter this year. If you’re curious, here are pictures: http://amperka.ru/collection/troyka

1 Like