LED lights automatically switch off

Hi:
1 second LED lights automatically switch off for , an example of how to write?

@ison Your question is not clear, could you write a bit more descriptive? if i understood true you can do this with this example.

http://docs.spark.io/#/examples/blink-an-led

const int button = D0; // the number of the pushbutton pin
const int led = D0; // the number of the LED pin

// variables will change:
int buttonState = 0; // variable for reading the pushbutton status

void setup() {
// initialize the LED pin as an output:
pinMode(led, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(button, INPUT);
}

void loop(){
// read the state of the pushbutton value:
buttonState = digitalRead(button);

// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(led, HIGH);
}
else {
// turn LED off:
digitalWrite(led, LOW);
}
}

How to write is correct?

Hi @ison - it looks like you’ve got the button and the LED attached to the same pin. You’ll need to put them on two different pins. Other than that, i think your code will work.

I wanted to via Tinker app just do and LED opens and automatically closes.