so i adapted a tutarial from the refrence board to see it i could randomly dim a led ... how ever when i run the new code i get "randNumber not declared in this scope"
void loop() {
// print a random number from 0 to 299
int randNumber = random(300);
Serial.println(randNumber);
analogWrite(11,randnumber);
// print a random number from 10 to 19
randNumber = random(10, 20);
Serial.println(randNumber);
brenden_nerd_:
so i adapted a tutarial from the refrence board to see it i could randomly dim a led ... how ever when i run the new code i get "randNumber not declared in this scope"
In your loop function you declare 'randNumber', but you try analogWrite 'randnumber'.
Be careful with uppercase/lowercase spelling!
'randNumber', 'randnumber', 'RaNdNuMbEr' and "rAnDnUmBeR' are completely different identifier names in the C/C++ programming language!
You also tend to read/print error messages as you believe they are rather than as they really are. This is why this forum prefers copy and paste. I think that the error message was closer to:
"randnumber not declared in this scope"
(Notice that the letter N in the middle of randnumber is NOT capitalized.)