Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Note that this sketch uses LED_BUILTIN to find the pin with the internal LED
- int ledState = LOW;
- unsigned long previousMillis = 0;
- const long interval = 1000;
- void setup() {
- pinMode(LED_BUILTIN, OUTPUT);
- Serial.begin(115200);
- }
- void loop()
- {
- unsigned long currentMillis = millis();
- if(currentMillis - previousMillis >= interval) {
- previousMillis = currentMillis;
- if (ledState == LOW)
- ledState = HIGH; // Note that this switches the LED *off*
- else
- ledState = LOW; // Note that this switches the LED *on*
- digitalWrite(LED_BUILTIN, ledState);
- Serial.println("led port " + String(LED_BUILTIN));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement