I am using Vex
RobotC
and have a function: setTouchLEDRGB(portx, R,G,B);
which sets the RGB colour of a touch LED.
I have 9 TouchLEDs and want to change the colour of them all at once, now annoyingly this is 9 lines of code at a time, i hope to create a function with an iteration such as:
for (int i = 0, i < 9, i++)
{
setTouchLEDRGB(port[i], R, G, B);
}
Is there a way to accomplish this?
Not sure about the platform, but you could create an array containg the ports: