Advertisement
pleasedontcode

**LED Control** rev_10

Feb 7th, 2025
38
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: **LED Control**
  13.     - Source Code NOT compiled for: Arduino Uno
  14.     - Source Code created on: 2025-02-08 01:23:44
  15.  
  16. ********* Pleasedontcode.com **********/
  17.  
  18. /****** SYSTEM REQUIREMENTS *****/
  19. /****** SYSTEM REQUIREMENT 1 *****/
  20.     /* say hello on serial monitor */
  21. /****** SYSTEM REQUIREMENT 2 *****/
  22.     /* Implement a feature to send a greeting message to */
  23.     /* the Serial Monitor when the Arduino initializes, */
  24.     /* ensuring the message is clear and visible for */
  25.     /* debugging purposes. */
  26. /****** END SYSTEM REQUIREMENTS *****/
  27.  
  28. /* START CODE */
  29.  
  30. /****** DEFINITION OF LIBRARIES *****/
  31. #include <Arduino.h> // Include Arduino library for basic functions
  32.  
  33. /****** FUNCTION PROTOTYPES *****/
  34. void setup(void);
  35. void loop(void);
  36. void updateOutputs(void); // Function prototype for updateOutputs
  37.  
  38. /***** DEFINITION OF DIGITAL OUTPUT PINS *****/
  39. const uint8_t myLED_LED_PIN_D2 = 2;
  40.  
  41. /***** DEFINITION OF OUTPUT RAW VARIABLES *****/
  42. /***** used to store raw data *****/
  43. bool myLED_LED_PIN_D2_rawData = 0;
  44.  
  45. /***** DEFINITION OF OUTPUT PHYSICAL VARIABLES *****/
  46. /***** used to store data after characteristic curve transformation *****/
  47. float myLED_LED_PIN_D2_phyData = 0.0;
  48.  
  49. void setup(void)
  50. {
  51.     // put your setup code here, to run once:
  52.     Serial.begin(9600); // Initialize serial communication at 9600 baud rate
  53.     pinMode(myLED_LED_PIN_D2, OUTPUT); // Set the LED pin as output
  54.  
  55.     // Send greeting message to Serial Monitor
  56.     Serial.println("Hello! Arduino has initialized successfully."); // Greeting message
  57. }
  58.  
  59. void loop(void)
  60. {
  61.     // put your main code here, to run repeatedly:
  62.     updateOutputs(); // Refresh output data
  63. }
  64.  
  65. void updateOutputs(void)
  66. {
  67.     digitalWrite(myLED_LED_PIN_D2, myLED_LED_PIN_D2_rawData); // Update the LED state
  68. }
  69.  
  70. /* END CODE */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement