Advertisement
Raqeeb_Alnakib

Best Lesson Script "LED Controlling by Arduino"

Oct 19th, 2019
6,327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  
  3. Please, Don't Miss Visit My Site:
  4.  
  5.  
  6. https://global-prog.com
  7.  
  8.  
  9. */
  10.  
  11.  
  12.  
  13.  
  14. int LED_Pin = 5;
  15.  
  16. void setup()
  17. {
  18.  
  19. /* ####### This code will running for once ######## */
  20.  
  21. pinMode(LED_Pin,OUTPUT); //  Make the LED_Pin as an output pin.
  22.  
  23. digitalWrite(LED_Pin,HIGH); // Turn the LED ON.
  24.  
  25. delay(250); // Waiting for a 250-milliseconds
  26.  
  27. digitalWrite(LED_Pin,LOW); // Turn the LED OFF.
  28.  
  29. delay(250); // Waiting for a 250-milliseconds
  30. }
  31.  
  32. void loop()
  33. {
  34. /* This code will running as repeatedly */
  35.  
  36. digitalWrite(LED_Pin,HIGH); // Turn the LED ON.
  37.  
  38. delay(500); // Waiting for a 500-milliseconds
  39.  
  40. digitalWrite(LED_Pin,LOW); // Turn the LED OFF.
  41.  
  42. delay(1000); // Waiting for a second = 1000 mS.
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement