Arduino Troubleshooter

Error Code: 2
Type of Problem/Error: Compile Time
Problem or Error Message:

...was not declared in this scope

Possible Solutions: You probably mispelled or miscapitalized a command or variable name. Common examples include:

  1. 'pinmode' → pinMode (the M must be capitalized)
  2. 'digitalwrite' → digitalWrite (the W must be capitalized)
  3. If you declare a variable as redLED, then you must always refer to it the exact same way. redled or redLed will result in this error.
  4. Every letter in the Arduino constants used to set pins HIGH and LOW must be capitalized.