led clear

Author:
License: GPL
Github: rbrt/push/led clear.axo

Inlets

int32 row

bool32.rising clear

bool32.rising clearAll

Outlets

None

Attributes

objref LED

Declaration
bool trig;
bool dorow;
bool trigall;
bool doall;
uint8_t count;
Control Rate
if (inlet_clear && (!trig && !count)) {
  trig = 1;
  dorow = 1;
}
if (dorow && !attr_LED.ROW) {
  dorow = 0;
  memset(&attr_LED.array[(inlet_row * 77) + 8], 32, 68);
  attr_LED.ROW = inlet_row + 1;
}
if (!inlet_clear && !dorow)
  trig = 0;

if (inlet_clearAll && !trigall) {
  trigall = 1;
  count = 4;
  attr_LED.LOCKED = 1;
}

if (count && !attr_LED.ROW) {
  memset(&attr_LED.array[((count - 1) * 77) + 8], 32, 68);
  attr_LED.ROW = count;
  count--;
  if (!count)
    attr_LED.LOCKED = 0;
}

if (!inlet_clearAll && !count)
  trigall = 0;

Privacy

© 2024 Zrna Research