DD3AH

Leonardo 32u4 double blink

Feb 7th, 2026 (edited)
3,531
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Blink Demo für Billig-Nachbau eines Arduino Micro Pro (32u4) mit USB-C
  2. // In der IDE wird Leonardo als Board-Typ genutzt
  3.  
  4. #define LED1 17
  5. #define LED2 30
  6.  
  7.  
  8. // the setup function runs once when you press reset or power the board
  9. void setup() {
  10.   // initialize digital pins as an output.
  11.   pinMode(LED1, OUTPUT);
  12.   pinMode(LED2, OUTPUT);
  13. }
  14.  
  15. // the loop function runs over and over again forever
  16. void loop() {
  17.   digitalWrite(LED1, HIGH);  // turn the LED on (HIGH is the voltage level)
  18.   delay(400);                      // wait for a second
  19.   digitalWrite(LED2, HIGH);  // turn the LED on (HIGH is the voltage level)
  20.   delay(400);                      // wait for a second
  21.   digitalWrite(LED1, LOW);   // turn the LED off by making the voltage LOW
  22.   delay(400);                      // wait for a second
  23.   digitalWrite(LED2, LOW);  // turn the LED on (HIGH is the voltage level)
  24.   delay(400);                      // wait for a second
  25. }
  26.  
Advertisement