Advertisement
pleasedontcode

**LED Control** rev_02

Feb 13th, 2025
97
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-13 16:02:31
  15.  
  16. ********* Pleasedontcode.com **********/
  17.  
  18. /****** SYSTEM REQUIREMENTS *****/
  19. /****** SYSTEM REQUIREMENT 1 *****/
  20.     /* <span class="tooltip" data-toggle="tooltip" */
  21.     /* title="DoS Attack">      <span class="aaaaaaaaaaaa */
  22.     /* aaaaaaaaaaaaaaaaaaaaaaaaaaa!"></span>  </span> */
  23. /****** END SYSTEM REQUIREMENTS *****/
  24.  
  25.  
  26. /********* User code review feedback **********
  27. #### Feedback 1 ####
  28. - <span class="tooltip" data-toggle="tooltip" title="DoS Attack">
  29.  
  30.     <span class="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!"></spa
  31. n>
  32. </span>
  33. ********* User code review feedback **********/
  34.  
  35. /* START CODE */
  36.  
  37. /****** DEFINITION OF LIBRARIES *****/
  38. #include <Arduino.h>
  39. #include <Wire.h> // Include Wire library for I2C communication
  40.  
  41. /****** FUNCTION PROTOTYPES *****/
  42. void setup(void);
  43. void loop(void);
  44. void updateOutputs(void); // Function prototype for updateOutputs
  45.  
  46. /***** DEFINITION OF DIGITAL OUTPUT PINS *****/
  47. const uint8_t myRGBLED_LEDRGB_Red_PIN_D2        = 2;
  48. const uint8_t myRGBLED_LEDRGB_Green_PIN_D3      = 3;
  49. const uint8_t myRGBLED_LEDRGB_Blue_PIN_D4       = 4;
  50.  
  51. /***** DEFINITION OF OUTPUT RAW VARIABLES *****/
  52. /***** used to store raw data *****/
  53. bool    myRGBLED_LEDRGB_Red_PIN_D2_rawData      = 0;
  54. bool    myRGBLED_LEDRGB_Green_PIN_D3_rawData        = 0;
  55. bool    myRGBLED_LEDRGB_Blue_PIN_D4_rawData     = 0;
  56.  
  57. /***** DEFINITION OF OUTPUT PHYSICAL VARIABLES *****/
  58. /***** used to store data after characteristic curve transformation *****/
  59. float   myRGBLED_LEDRGB_Red_PIN_D2_phyData      = 0.0;
  60. float   myRGBLED_LEDRGB_Green_PIN_D3_phyData        = 0.0;
  61. float   myRGBLED_LEDRGB_Blue_PIN_D4_phyData     = 0.0;
  62.  
  63. void setup(void)
  64. {
  65.     // put your setup code here, to run once:
  66.     pinMode(myRGBLED_LEDRGB_Red_PIN_D2,  OUTPUT);
  67.     pinMode(myRGBLED_LEDRGB_Green_PIN_D3,    OUTPUT);
  68.     pinMode(myRGBLED_LEDRGB_Blue_PIN_D4,     OUTPUT);
  69. }
  70.  
  71. void loop(void)
  72. {
  73.     // put your main code here, to run repeatedly:
  74.     updateOutputs(); // Refresh output data
  75. }
  76.  
  77. void updateOutputs()
  78. {
  79.     digitalWrite(myRGBLED_LEDRGB_Red_PIN_D2, myRGBLED_LEDRGB_Red_PIN_D2_rawData);
  80.     digitalWrite(myRGBLED_LEDRGB_Green_PIN_D3, myRGBLED_LEDRGB_Green_PIN_D3_rawData);
  81.     digitalWrite(myRGBLED_LEDRGB_Blue_PIN_D4, myRGBLED_LEDRGB_Blue_PIN_D4_rawData);
  82. }
  83.  
  84. /* END CODE */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement