Having trouble turning Pin 13 off.

This is the only place in the application where Pin 13 is mentioned:

  digitalWrite(pin13, LOW);

The rest of the program works fine. ???

http://snippets-r-us.com/

Is it an output?

Are you using SPI? All these questions would have been answered if you had posted your code.

even if you think that's the problem it may not always be that obvious. The rest of your code, possible whats connected to that pin, and the reason you think it's not turning off are very important in you receiving any type of assistance in this.

What you have posted thus far is me telling you my car wont start even though i am turning the key and asking you to solve that problem. Not very functional....

[quote author=Nick Gammon link=msg=2104103 date=1424494281] http://snippets-r-us.com/

Is it an output? [/quote]

Why does it not surprise me that you have actually made that page a real thing??

Awesomness. :grinning:

what do you mean by "turn pin 13 off" ?

how do you know that pin 13 is turned on ?

which board are you using ?

If you just want to turn the built-in led off, make sure it's set as an output:

pinMode(13, OUTPUT);

Then, fix your code. Unless you defined pin13 as a variable or macro like this

int pin13 = 13;

or

#define pin13 13

you should use the number of the pin you want to set, like this:

digitalWrite(13, LOW);

You can use pin13 as in your code, but only if you've set a variable or macro as in the previous codes.

If you go with the macro (#define), make sure you don't use a semicolon. The difference between the two versions is that macros get replaced in the code during compilation time. Variables would take memory space and are parsed during runtime, which require more memory and processing.

Honduras: This is the only place in the application where Pin 13 is mentioned:

  digitalWrite(pin13, LOW);

The rest of the program works fine. ???