Timer setup to blink LED

I have created a channel by channel translator and wish to (whilst the translator is running) create a "for next loop?) to infinitely blink one of the buttons on and off until the translator changed.

The [TRACK SELECTION] button resides at 0x33 so:
<CHANNEL No / 90 … 97> 33 xx reads the button press (on APC40), and
<CHANNEL No / 90 … 97> 33 7F (to APC40) will illuminate it
<CHANNEL No / 90 … 97> 33 00 (to APC40) to switch off.

Is it possible to set this blinking into a single translator?

Many thanks,

Hi,
Here is an example.
The Init preset handles normal housekeeping including initializing global variables and the APC40 MKII to mode 2.
The Working preset handles clearing old LED’s and starting the blink timer.
The LED Feedback preset has the Blink Channel Timer

Global variables used

ga=which channel to blink
gb = blink toggle state (0 or 1)
gc = time in milliseconds to blink the target LED.

When the incoming message of 9x 33 7f comes in the value of ga is set to the current MIDI channel x. The LED’s are all cleared and the blink timer starts.

The always repeating blink timer toggles the state of gb and sets the note message to the currently active outgoing MIDI channel ga.

APC40-Blink-2021-07-07.bmtp (2.1 KB)

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz
1 Like

Where does the global var GD come into play? Apologies for ignorance here!

I’m not using gd in this project. Only ga, gb and gc.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

I see my error. I’d opened an older example of led blinking for a different controller. Sorry!

Works like a charm! Removed the global channel side of things to trigger only on the higher channels, but it works! Thanking you.

My pleasure!

1 Like

Here it is !

Nice!

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz