delay doesn't work properly

Hello,

delay works fine, but I can only be on 1000ms, if I choose something else like 30ms, then it will happen in 1 second and go back to 1000ms.

I have a Arduino UNO R3 and if you also know how to make a pin press my phone, I would also like help with that.

void setup() {
    digitalWrite(13,LOW);
}

void loop() {
    pinMode(13,INPUT);
    delay(1000);
    pinMode(13,OUTPUT);
    delay(1000);
}

That is the working code, right?

Post the code that isn't working.

Lutherion:
I have a Arduino UNO R3 and if you also know how to make a pin press my phone, I would also like help with that.

Nobody is going to be able to help with such an incredibly vague description but let's keep this thread specifically for your delay issue. If you can't even get delay() working you are a long ways from being able to start on whatever this pin pressing a phone project is.

Lutherion:
delay works fine, but I can only be on 1000ms, if I choose something else like 30ms, then it will happen in 1 second and go back to 1000ms.

You need to post the program that behaves like that.

how to make a pin press my phone,

I don’t understand

…R

I'm using arduino web version, and my build is a arduino uno r3 with a jumper wire in hole number 13 and it ends In aluminium foil on phone with tape, to hold it in place.

If you want help with the delay issue you need to post the non-working code, as you’ve already been asked to do twice before.

As for the phone thing, you still haven’t explained what you’re trying to accomplish.

void setup() {
    digitalWrite(13,LOW);
}

void loop() {
    pinMode(13,INPUT);
    delay(1000);
    pinMode(13,OUTPUT);
    delay(1000);
}

It would help if you had things in the right places. You should set the pinMode once in the setup function. It does not make sense to continually change the pinMode from INPUT to OUTPUT and back again. The digitalWrite goes in the loop function.

void setup() {
    pinMode(13,OUTPUT);
}

void loop() {
    digitalWrite(13,HIGH);
    delay(1000);
    digitalWrite(13,LOW);
    delay(1000);
}

Pete

Tried to do this(Arduino smart phone clicker - Quick tutorial - YouTube), but now I have bought the starter edition, so I can actually learn something.