Advertisement
pleasedontcode

Digital Toggling rev_02

Jan 25th, 2024
117
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 Toggling
  13.     - Source Code compiled for: Arduino Uno
  14.     - Source Code created on: 2024-01-25 22:41:59
  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.  
  25. /********* User code review feedback **********
  26. #### Feedback 1 ####
  27. - no viscosity calculation of optical
  28. ********* User code review feedback **********/
  29.  
  30. /****** DEFINITION OF LIBRARIES *****/
  31. #include <Arduino.h>
  32.  
  33. /* FUNCTION PROTOTYPES */
  34. void setup(void);
  35. void loop(void);
  36.  
  37. /* DEFINITION OF DIGITAL OUTPUT PINS */
  38. const uint8_t sensor_led_PIN_D2 = 2; // Assigning pin 2 to sensor_led_PIN_D2
  39. const uint8_t sensor_led2_PIN_D3 = 3; // Assigning pin 3 to sensor_led2_PIN_D3
  40.  
  41. void setup()
  42. {
  43.     // initialize digital pins as output
  44.     pinMode(sensor_led_PIN_D2, OUTPUT);
  45.     pinMode(sensor_led2_PIN_D3, OUTPUT);
  46. }
  47.  
  48. void loop()
  49. {
  50.     // put your main code here, to run repeatedly:
  51.  
  52.     // Toggle the state of sensor_led_PIN_D2
  53.     digitalWrite(sensor_led_PIN_D2, HIGH);
  54.     delay(500);
  55.     digitalWrite(sensor_led_PIN_D2, LOW);
  56.     delay(500);
  57.  
  58.     // Toggle the state of sensor_led2_PIN_D3
  59.     digitalWrite(sensor_led2_PIN_D3, HIGH);
  60.     delay(500);
  61.     digitalWrite(sensor_led2_PIN_D3, LOW);
  62.     delay(500);
  63. }
  64.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement