Advertisement
pleasedontcode

"Digital Toggle" rev_01

Jan 25th, 2024
123
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: "Digital Toggle"
  13.     - Source Code compiled for: Arduino Uno
  14.     - Source Code created on: 2024-01-25 22:39:43
  15.  
  16. ********* Pleasedontcode.com **********/
  17.  
  18. /****** SYSTEM REQUIREMENTS *****/
  19. /****** SYSTEM REQUIREMENT 1 *****/
  20.     /* Falling Ball Viscometer with 2 optical sensors */
  21.     /* connected to plc */
  22. /****** END SYSTEM REQUIREMENTS *****/
  23.  
  24. /****** DEFINITION OF LIBRARIES *****/
  25. #include <Arduino.h>
  26.  
  27. /* FUNCTION PROTOTYPES */
  28. void setup(void);
  29. void loop(void);
  30.  
  31. /* DEFINITION OF DIGITAL OUTPUT PINS */
  32. const uint8_t sensor_led_PIN_D2 = 2; // Assigning pin 2 to sensor_led_PIN_D2
  33. const uint8_t sensor_led2_PIN_D3 = 3; // Assigning pin 3 to sensor_led2_PIN_D3
  34.  
  35. void setup(void)
  36. {
  37.     // initialize digital pins as output
  38.     pinMode(sensor_led_PIN_D2, OUTPUT);
  39.     pinMode(sensor_led2_PIN_D3, OUTPUT);
  40. }
  41.  
  42. void loop(void)
  43. {
  44.     // put your main code here, to run repeatedly:
  45.  
  46.     // Toggle the state of sensor_led_PIN_D2
  47.     digitalWrite(sensor_led_PIN_D2, HIGH);
  48.     delay(500);
  49.     digitalWrite(sensor_led_PIN_D2, LOW);
  50.     delay(500);
  51.  
  52.     // Toggle the state of sensor_led2_PIN_D3
  53.     digitalWrite(sensor_led2_PIN_D3, HIGH);
  54.     delay(500);
  55.     digitalWrite(sensor_led2_PIN_D3, LOW);
  56.     delay(500);
  57. }
  58.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement