void setup() {
// declare the ledPin as an OUTPUT:
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
pinMode(11,OUTPUT);
'ledPin' was not declared in this scope
void setup() {
// declare the ledPin as an OUTPUT:
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
pinMode(11,OUTPUT);
'ledPin' was not declared in this scope
'ledPin' was not declared in this scope
Well, what scope was it declared in?
Where is the rest of your code? Post the rest of your code if you want the rest of the answer.
you're calling pinMode() with 'ledPin' as the first argument.
You have not declared what pin ledPin is (or have declared it inside some other function, so it's not in scope); how is the compiler to know what ledPin is? - at the top of your sketch (outside of any functions - you almost always want variables referring to pins in the global scope) you need to declare it:
const byte ledPin = (whatever pin number it is);
or use a #define
#define ledPin (whatever pin number)
Note that the #define does not end in a ; - #defines are find/replace. Behavior is less weird if you use the first syntax I suggested.
Thank you