Hi can someone confirm if this snippet of code is correct please. I am trying to assign different values to an integer dependant on the state of a digital input (High or low) for a summer/ winter switch on an irrigation project. The bit I am not sure of is using the comma to separate the two statements
(Min = 70, Max = 73).
void loop() {
if (sum_win = HIGH){
(Min = 70, Max = 73);}
else if (sum_win = LOW){
(Min =50, Max = 55);
}
The code compiles ok but Im not sure if the way I have written it will do what I am expecting it to.
Thanks
Thanks for the pointers the sum_win was a short hand way of summer/winter ( as I want differnt miniumum / maximum paramiters for the respective seasons Not just a true/false ( i.e. switch closed and 5 volts present Min has a value of 70 or switch open and zero volts present Min has a value of 50), I didnt use a Slash as I thought it would read it as a division.
Yeah, the point was that you can't deduce the logic state from the name. If I say, "it is summer/winter", you don't know which, but if I say, "it is summer" or "it is winter", you do.