Skip to content

SetLEDState()

Arnd edited this page Dec 11, 2020 · 2 revisions

SetLEDState(NewState);

This function will set the LED lights on the encoder ON or OFF (true or false parameters). When setting the LEDs to "ON" they are all turned off by default until either explicitly set using SetColor or if a rotation or click occurs and the corresponding settings for SetCWTurnColor(), SetCCWTurnColor() or SetPushButtonColor are set to non-dark.


Example:

// Instantiate the class using all of the pins defined in constants     //
EncoderClass Encoder(ROTARY_PIN_1, ROTARY_PIN_2, PUSHBUTTON_PIN, RED_PIN, 
                     GREEN_PIN, BLUE_PIN);

void setup() {
  Serial.begin(115200);
  delay(1000);
  Encoder.SetColor(0,0,255);  // turn on full power blue
  delay(1000);                // wait...
  Encoder.SetLEDState(false); // turn off the lights
} // of method setup()
void loop(){
  // code goes here //
} // of method loop()