This is the code I'm using, #include <IRremote.h> int RECV_PIN = 11; IRrecv irrecv(RECV_PIN); decode_results results; void setup() { pinMode(13, OUTPUT); Serial.begin(9600); irrecv.enableIRIn(); // Start the receiver } int i=0; void loop() { if (irrecv.decode(&results)) { int result = int(results.value); if (result == -22441 || result==-1){ i+=5; } else { if (result == -8161){ digitalWrite(13, LOW); i=0; } } irrecv.resume(); // Receive the next value Serial.println(i); analogWrite(13,i); } }
For some reason, when i gets to about 123 the led is already at it's full brightness and, the funny thing is, at 122 the led is off. Why is this happening?
"I'm interested in that line, which is why I referred you to the reference page."
Yup, figured that out after reading the first sentence of that page you directed me to right after you posted your first post --just didn't reply right away.