Open Niutonian opened 2 years ago
There's syntax issues with the if conditional statements.
Change:
if (cRed = 9) {
if (cGreen = 12) {
if (cBlue = 15) {
To:
if (cRed == 9) {
if (cGreen == 12) {
if (cBlue == 15) {
I didn't review your code for any other errors, just noticed the conditional typos.
Thank you for your help, I will give it a try and post the entire code if it works.
Hello, I love your library, and I would like to know if you could help me figure out a solution to my problem.
I am trying to use multiple sliders, but I can't figure out how to pass different values for each.
I'm a novice, so I may not fully understand how to do it. Here is my code:
Above setup: ` int sliderValueWithOffset; int cRed; int cGreen; int cBlue;
void slider(Control* sender, int type) { Serial.print("Slider: ID: "); Serial.print(sender->id); Serial.print(", Value: "); Serial.println(sender->value); // Like all Control Values in ESPUI slider values are Strings. To use them as int simply do this: sliderValueWithOffset = sender->value.toInt() + 100;
}`
in setup:
cRed = ESPUI.slider("Slider Red", &slider, ControlColor::Alizarin, 255); cGreen =ESPUI.slider("Slider Green", &slider, ControlColor::Alizarin, 0); cBlue = ESPUI.slider("Slider Blue", &slider, ControlColor::Alizarin, 0);
in loop: ` Serial.println(cRed); Serial.println(cGreen); Serial.println(cBlue);
` all these pass the same value, how should I separate them?
Thank you