What is wrong with my code? RGB potentiometer Arduino programming has been a huge learning curve for me and I am trying to create a project with an rgb that's color is determined by a potentiometer. To where the further I turn it, the further across the rainbow spectrum it goes. I can't figure out how to do all values in between because I am not educated enough but I came up with this basic code...

int redpin = 6;
int greenpin = 3;
int bluepin = 5;
int potPin = 0;


void setup() {
  // put your setup code here, to run once:
  pinMode(redpin, OUTPUT);
  pinMode(bluepin, OUTPUT);
  pinMode(greenpin, OUTPUT);
  pinMode(potPin, INPUT);
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  int wavecolor = analogRead(potPin);
  Serial.print(wavecolor);
  {
    if (wavecolor = 0) {
      setColor(255, 0, 0);  // red
    }
    if (wavecolor &gt; 0 or wavecolor &lt; 333) {
      setColor(0, 255, 0);  // green
    }
    if (wavecolor &gt; 333 or wavecolor &lt; 667) {
      setColor(0, 0, 255);  // blue
    }
    if (wavecolor &gt; 667 or wavecolor &lt; 1022) {
      setColor(255, 255, 0);  // yellow
    }
    if (wavecolor = 1023) {
      setColor(80, 0, 80);  // purple
    }
  }
}

void setColor(int red, int green, int blue)
{
#ifdef COMMON_ANODE
  red = 255 - red;
  green = 255 - green;
  blue = 255 - blue;
#endif
  analogWrite(redpin, red);
  analogWrite(greenpin, green);
  analogWrite(bluepin, blue);
}


And for some reason, where the light should change colors once the potentiometer goes past a certain number, the light just flickers and only changes colors to white when it is all the way up or down. Also, it has a weird flickery yellow color. 
Since I am new to this, can one of you better educated people be willing to assist me?
Equality comparison in C and C++ is expressed by == operator. ==, not =. This

if (wavecolor = 0) {


actually assigns zero to your wavecolor variable, thus destroying the value you just read.
The common sense says that you actually need and in your conditions, not or 

if (wavecolor &gt; 0 and wavecolor &lt; 333) {


The or conditions that you curently use are simply always true, which makes them nonsensical.
This is valid syntax

wavecolor &gt; 0 or wavecolor &lt; 333
wavecolor &gt; 0 and wavecolor &lt; 333


but you might want to try using more "canonical" forms

wavecolor &gt; 0 || wavecolor &lt; 333
wavecolor &gt; 0 &amp;&amp; wavecolor &lt; 333


or and and are "alternative" forms of || and &amp;&amp; operators, introduced a long time ago for reasons that are all but obsolete today.
Assuming that you meant and instead of or, in your conditions you managed to "exclude" such values as 333, 667 and 1022 - they wouldn't match any of and conditions. Changing some strict comparisons to non-strict ones might be in order. 
As a side note, in a single-file program all file-scope variables should be either const or static. In your case

const int redpin = 6;
const int greenpin = 3;
const int bluepin = 5;
const int potPin = 0;