@Scruff, sorry but I’m running into another problem. I’m kind of a noob when it comes to coding on as big of a scale I am in this project. Im using 2 sliders to set preferences for when I hit the start button. I can’t get the values of the sliders to be used in the running function. I want the a different combination of LEDs to light up depending on what the sliders values are. However the values of the sliders don’t seem to be having an impact on the lights that light up. The sliders are on a different page so I set their vscope to global so the values don’t reset once the page is changed back to the main screen where the start button is.
Here is the code.
if(Start_State)
{
LengthSelect.getValue(&MixingTime); //Slider 1 (value goes from 0 to 100)
WaterSelect.getValue(&WaterAmount); //Slider 2 (value goes from 0 to 100)
if((0 <= MixingTime <= 33) && (0 <= WaterAmount <= 33))
{
digitalWrite(BLUE, HIGH);
digitalWrite(YELLOW, HIGH);
delay(1000);
SB->setValue(0);
digitalWrite(BLUE, LOW);
digitalWrite(YELLOW, LOW);
}
else if((34 <= MixingTime <= 66) && (0 <= WaterAmount <= 33))
{
digitalWrite(GREEN, HIGH);
delay(1000);
SB->setValue(0);
digitalWrite(GREEN, LOW);
}
else if((67 <= MixingTime <= 100) && (0 <= WaterAmount <= 33))
{
digitalWrite(BLUE, HIGH);
digitalWrite(RED, HIGH);
digitalWrite(GREEN, HIGH);
digitalWrite(YELLOW, HIGH);
delay(1000);
SB->setValue(0);
digitalWrite(BLUE, LOW);
digitalWrite(RED, LOW);
digitalWrite(GREEN, LOW);
digitalWrite(YELLOW, LOW);
}
I feel like I could just be trying to use the values in the wrong mannor or be typing the code improperly. Any feedback, advise, or help is greatly appreciated. More code can be provided if necessary.