Equality comparison in C and C++ is expressed by
==operator.==, not=. Thisif (wavecolor = 0) {
actually assigns zero to your wavecolor variable, thus destroying the value you just read.
This is valid
if (wavecolor > 0 or wavecolor < 333)
but you might want to try using a more "canonical" form
if (wavecolor > 0 || wavecolor < 333) or is an "alternative" form of || operator, introduced a long time ago for reasons that are obsolete today.
However, the common sense says that you actually need && here, which is and, not or.
In your conditions you managed to "exclude" such values as
333,667and1022- they don't match any of your conditions.As a side note, in a single-file program all file-scope variables should be either
constorstatic. In your caseconst int redpin = 6; const int greenpin = 3; const int bluepin = 5; const int potPin = 0;