const int ledPin=2;// the LED pin number connected
int ledState = LOW; // used to set the LED state
unsigned long previousMillis = 0; //will store last time LED was blinked
const long period = 1000; // period at which to blink in ms
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(ledPin, OUTPUT); // set ledpin as output
}
void loop() {
// put your main code here, to run repeatedly:
unsigned long currentMillis = millis(); // store the current time
if (currentMillis - previousMillis >= period) { // check if 1000ms passed
previousMillis = currentMillis; // save the last time you blinked the LED
if (ledState == LOW) { // if the LED is off turn it on and vice-versa
ledState = HIGH;
} else {
ledState = LOW;
}
digitalWrite(ledPin, ledState);//set LED with ledState to blink again
}
}
nano:12
nano:11
nano:10
nano:9
nano:8
nano:7
nano:6
nano:5
nano:4
nano:3
nano:2
nano:GND.2
nano:RESET.2
nano:0
nano:1
nano:13
nano:3.3V
nano:AREF
nano:A0
nano:A1
nano:A2
nano:A3
nano:A4
nano:A5
nano:A6
nano:A7
nano:5V
nano:RESET
nano:GND.1
nano:VIN
nano:12.2
nano:5V.2
nano:13.2
nano:11.2
nano:RESET.3
nano:GND.3
r1:1
r1:2
led1:A
led1:C