Function wont go low?

So in my sketch i have in setup up. DigitalWrite(30, LOW);

But it wont go low?

If i go from 30 to ground digitalRead will recognise it. But it wont start as low and every other one will?

My code is to long to post in one reply..

What board are you using? Have you set the pin to be an output?

Mega.

And ya i have it as n output

Its identical to 8 other things in the code... Theres no reason it should be this way

Your code is too long to post. Use the Blink example and change the pin to 30, see if it works ie. does the pin change from HIGH to LOW each second? If so you know that the problem is with your code- if not then it might be a hardware problem. Do you have anything connected to pin 30 at the moment?

jokefox: So in my sketch i have in setup up. DigitalWrite(30, LOW);

But it wont go low?

If i go from 30 to ground digitalRead will recognise it. But it wont start as low and every other one will?

My code is to long to post in one reply..

Are you expecting that if you do

digitalWrite(30, LOW);

that

digitalRead(30);

will return LOW ?

What is connected to pin 30 ?

Theres nothing connected to 30. I tried other ones also...

Im reading it to print on an sd card.

Its in a switch case thing. I just changed the case order from "1,2,0" to 0,2,1.

Its quick and dirty and for right now it works. Just kinda wierd how when i digitalwrite it in setup to be low that it by passes it and stays high.

Every other one works how i want but that one..

What ordrr do cases go in a switch statment?

Is it the order you write it in? Or order of numbers?

If i have it 2,1,0 will it follow that flow? Or will it go 0,1,2 all the time?

Theres nothing connected to 30.

So why not just set a variable to LOW ?

Is it the order you write it in? Or order of numbers?

Neither

Only the case that matches the switch variable will be executed

The switch is a button push counter. So one click it does this. Next click this. Next click this. Then reset

I have them numbered 1,2,0 So will it default start on 1 because its first or 0 because 0 comes numerically first?

Post a minimal compiling example of your "switch case thing".

I assume that you use expressions that do not work as you expect.

So will it default start on 1 because its first or 0 because 0 comes numerically first?

It will start at the state equal to the value of the switch variable. If none of the states match the value of the switch variable and you have a default: state in the switch/state then the code for the default: state will be executed.

As requested, please post a small but complete example that illustrates your problem.