2

I'm new to all of this, but it's there a way to group a cluster of pins to one variable? I don't necessarily want the grouped pounds to be sequential.

Erik
  • 21
  • 1

2 Answers2

4

Only if you drop to low-level access, and only if the pins are on the same port.

#define pinset 0x55

 ...

PORTC |= pinset;
delay(1000);
PORTC &= ~pinset;
Ignacio Vazquez-Abrams
  • 17,663
  • 1
  • 27
  • 32
0

In the example of the constellations, consider using an array for each constellation where each element in the array corresponds to an LED output pin. You could simply put a 1 or a 0 in each array element to indicate if you want the corresponding LED output pin on or off. It would be easy then to create a function that you would pass a constellation array and would turn the LED output pins on or off based on the contents of the array.

linhartr22
  • 596
  • 4
  • 10