AddDominator wrote:
How to add more LED mode for RGB ? Like pressing a button and it will change the mode. My code is like thisint ButtonZ = 9;
int ButtonX = 10;
void setup()
{
pinMode(ButtonZ, INPUT);
pinMode(ButtonX, INPUT);
}
void loop()
{
if (digitalRead(ButtonZ) == 0)
{
Keyboard.press('z');
delay(5);
}
if (digitalRead(ButtonZ) == 1)
{
Keyboard.release('z');
}
if (digitalRead(ButtonX) == 0)
{
Keyboard.press('x');
delay(5);
}
if (digitalRead(ButtonX) == 1)
{
Keyboard.release('x');
}
}
just use switch()