So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By Numian
#88113 Hello,
I have this simple code:

Code: Select allvoid action() {
  digitalWrite(2, HIGH);
  delay(2000);
  digitalWrite(2, LOW);
  }

void setup() {
  pinMode(2, OUTPUT);
  action();
}

void loop() {
}


Why PIN never goes LOW? I am measuring continuity between D4 and GND.

Thank you.
User avatar
By Numian
#88118 If I put that function into loop(), PIN is 'blinking' HIGH-LOW over and over again, but i need it to do only one during setup. What did I wrong?

Thanks again.
User avatar
By Numian
#88121
icons wrote:because its in your loop, instead put it in setup

I did. See my first post. Problem is, pin stays HIGH and doesn't go LOW after 2 seconds, as it should. I have no idea why.