hi, i am a beginner in programming. i have a problem and any help will be very much appreciated.
i am trying to program a color sensor where a variable is incremented whenever it detects the same color.
(example is if it detects a green, x will be incremented by one.)
my code is like this:
sColor = "Green";
x = x+1;
sColor = "???";
but i'm not getting the output that i want.
whenever it sees a green, x is always incrementing continuously.
i want it to only increase by 1 one at a time in every detection.
(i apologize for my grammar :] )
can anyone help me with this. thanks a lot.