Thanks! I was able to get it to mostly work (At least the PWM functionality)
I had to strip almost all the PIR and other code out to be able to test 3 channel PWM
#define REDPIN 0
#define GREENPIN 1
#define BLUEPIN 4
#define PIR 3
boolean human_detected = false;
unsigned long timer;
int r, g, b;
#define FADESPEED 10 // make this higher to slow down
void setup() {
pinMode(PIR, INPUT);
pinMode(REDPIN, OUTPUT);
pinMode(GREENPIN, OUTPUT);
pinMode(BLUEPIN, OUTPUT);
analogWrite(REDPIN, 0);
analogWrite(GREENPIN, 0);
analogWrite(BLUEPIN, 0);
}
void loop() {
for (r = 0; r < 255; r++) {
analogWrite(REDPIN, r);
analogWrite(GREENPIN, r);
analogWrite(BLUEPIN, r);
delay(FADESPEED);
}
}