pleasedontcode

Blinking Startup rev_15

Oct 6th, 2025
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /********* Pleasedontcode.com **********
  2.  
  3.     Pleasedontcode thanks you for automatic code generation! Enjoy your code!
  4.  
  5.     - Terms and Conditions:
  6.     You have a non-exclusive, revocable, worldwide, royalty-free license
  7.     for personal and commercial use. Attribution is optional; modifications
  8.     are allowed, but you're responsible for code maintenance. We're not
  9.     liable for any loss or damage. For full terms,
  10.     please visit pleasedontcode.com/termsandconditions.
  11.  
  12.     - Project: Blinking Startup
  13.     - Source Code NOT compiled for: Arduino Uno
  14.     - Source Code created on: 2025-10-06 23:27:28
  15.  
  16. ********* Pleasedontcode.com **********/
  17.  
  18. /****** SYSTEM REQUIREMENTS *****/
  19. /****** SYSTEM REQUIREMENT 1 *****/
  20.     /* give me example led */
  21. /****** END SYSTEM REQUIREMENTS *****/
  22.  
  23.  
  24. /* START CODE */
  25.  
  26. /****** DEFINITION OF LIBRARIES *****/
  27. #include <Arduino.h>
  28.  
  29. /****** FUNCTION PROTOTYPES *****/
  30. void setup(void);
  31. void loop(void);
  32.  
  33. /***** LED example configuration *****/
  34. const uint8_t LED_PIN = 13; // Built-in LED on UNO
  35. unsigned long previousMillis = 0;
  36. const unsigned long interval = 500; // Blink interval in milliseconds
  37. bool ledState = false;
  38.  
  39. void setup(void)
  40. {
  41.     // put your setup code here, to run once:
  42.     pinMode(LED_PIN, OUTPUT);
  43.     digitalWrite(LED_PIN, LOW);
  44.     // Initialize Serial for hello message
  45.     Serial.begin(9600);
  46.     Serial.println("buenas"); // Say buenas on startup
  47.     // LED example initialisation complete
  48. }
  49.  
  50.  
  51. void loop(void)
  52. {
  53.     // put your main code here, to run repeatedly:
  54.     unsigned long currentMillis = millis();
  55.     if (currentMillis - previousMillis >= interval)
  56.     {
  57.         previousMillis = currentMillis;
  58.         ledState = !ledState;
  59.         digitalWrite(LED_PIN, ledState ? HIGH : LOW);
  60.     }
  61. }
  62.  
  63. /* END CODE */
  64.  
Advertisement
Add Comment
Please, Sign In to add comment