Advertisement
pleasedontcode

**LED Control** rev_01

Mar 10th, 2025
234
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-03-10 10:11:56
  15.  
  16. ********* Pleasedontcode.com **********/
  17.  
  18. /****** SYSTEM REQUIREMENTS *****/
  19. /****** SYSTEM REQUIREMENT 1 *****/
  20.     /* carrefour avec Bouton */
  21. /****** END SYSTEM REQUIREMENTS *****/
  22.  
  23. /* START CODE */
  24.  
  25. /****** DEFINITION OF LIBRARIES *****/
  26. #include <Arduino.h> // Include Arduino core library
  27. #include <Wire.h>    // Include Wire library for I2C communication
  28. #include <SPI.h>     // Include SPI library for SPI communication
  29.  
  30. /****** FUNCTION PROTOTYPES *****/
  31. void setup(void);
  32. void loop(void);
  33. void updateOutputs(void); // Function prototype for updating outputs
  34.  
  35. /***** DEFINITION OF DIGITAL OUTPUT PINS *****/
  36. const uint8_t myLED_LED_PIN_D2 = 2; // Define LED pin
  37.  
  38. /***** DEFINITION OF OUTPUT RAW VARIABLES *****/
  39. /***** used to store raw data *****/
  40. bool myLED_LED_PIN_D2_rawData = 0; // Raw data for LED
  41.  
  42. /***** DEFINITION OF OUTPUT PHYSICAL VARIABLES *****/
  43. /***** used to store data after characteristic curve transformation *****/
  44. float myLED_LED_PIN_D2_phyData = 0.0; // Physical data for LED
  45.  
  46. void setup(void)
  47. {
  48.     // put your setup code here, to run once:
  49.     pinMode(myLED_LED_PIN_D2, OUTPUT); // Set LED pin as output
  50. }
  51.  
  52. void loop(void)
  53. {
  54.     // put your main code here, to run repeatedly:
  55.     updateOutputs(); // Refresh output data
  56. }
  57.  
  58. void updateOutputs(void)
  59. {
  60.     digitalWrite(myLED_LED_PIN_D2, myLED_LED_PIN_D2_rawData); // Write raw data to LED pin
  61. }
  62.  
  63. /* END CODE */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement