Why handle each input and LED separately when you can also use a 'for' loop there ...It wouldn't surprise me if you can optimise that even further but don't have a MicroPython on hand to try it -
Code:
while True: for i in range(len(leds)): if vu_meter[i].value() == 1: leds[i].value(1) else: leds[i].value(0)Code:
while True: for i in range(len(leds)): leds[i].value( vu_meter[i].value() )Statistics: Posted by hippy — Sun Mar 02, 2025 5:51 pm