-
Notifications
You must be signed in to change notification settings - Fork 0
SetCWTurnColor()
Arnd edited this page Dec 11, 2020
·
2 revisions
This function will set the color to which the encoder is set when the encoder is turned clockwise. The Red, Green and Blue values are set where 0 corresponds to full power on and 255 to off with corresponding PWM values in between. If the SetFade() is turned on then the light will fade to off after the encoder stops moving, otherwise it will remain at the set brightness level.
The default value for the clockwise turn is (0,255,0), or full brightness green color.
// 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.SetCWTurnColor(255,0,0); // turn on red for cw turn
delay(10000); // wait for 10 seconds for turns
Encoder.SetCWTurnColor(0,255,0); // turn on default green turn color
} // of method setup()
void loop(){
// code goes here //
} // of method loop()