Advertisement
pleasedontcode

"LED Communication" rev_13

Feb 8th, 2025
64
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 Communication"
  13.     - Source Code NOT compiled for: Arduino Uno
  14.     - Source Code created on: 2025-02-08 19:14:11
  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. #include <Serial.h>  // Include Serial library for serial communication
  33.  
  34. /****** FUNCTION PROTOTYPES *****/
  35. void setup(void);
  36. void loop(void);
  37. void updateOutputs(void);
  38.  
  39. /***** DEFINITION OF DIGITAL OUTPUT PINS *****/
  40. const uint8_t myLED_LED_PIN_D2 = 2;
  41.  
  42. /***** DEFINITION OF OUTPUT RAW VARIABLES *****/
  43. /***** used to store raw data *****/
  44. bool myLED_LED_PIN_D2_rawData = 0;
  45.  
  46. /***** DEFINITION OF OUTPUT PHYSICAL VARIABLES *****/
  47. /***** used to store data after characteristic curve transformation *****/
  48. float myLED_LED_PIN_D2_phyData = 0.0;
  49.  
  50. void setup(void)
  51. {
  52.     // put your setup code here, to run once:
  53.     pinMode(myLED_LED_PIN_D2, OUTPUT); // Set the LED pin as output
  54.  
  55.     // Initialize serial communication at 9600 baud rate
  56.     Serial.begin(9600);
  57.  
  58.     // Send a greeting message to the Serial Monitor
  59.     Serial.println("Hello! Arduino has initialized successfully.");
  60. }
  61.  
  62. void loop(void)
  63. {
  64.     // put your main code here, to run repeatedly:
  65.     updateOutputs(); // Refresh output data
  66. }
  67.  
  68. void updateOutputs(void)
  69. {
  70.     digitalWrite(myLED_LED_PIN_D2, myLED_LED_PIN_D2_rawData); // Update the LED state
  71. }
  72.  
  73. /* END CODE */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement