Advertisement
pleasedontcode

**RGB Control** rev_01

Feb 13th, 2025
99
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: **RGB Control**
  13.     - Source Code NOT compiled for: Arduino Uno
  14.     - Source Code created on: 2025-02-13 16:01:41
  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. /* START CODE */
  26.  
  27. /****** DEFINITION OF LIBRARIES *****/
  28. #include <Arduino.h>
  29. #include <Wire.h> // Include Wire library for I2C communication
  30.  
  31. /****** FUNCTION PROTOTYPES *****/
  32. void setup(void);
  33. void loop(void);
  34. void updateOutputs(void); // Function prototype for updateOutputs
  35.  
  36. /***** DEFINITION OF DIGITAL OUTPUT PINS *****/
  37. const uint8_t myRGBLED_LEDRGB_Red_PIN_D2        = 2;
  38. const uint8_t myRGBLED_LEDRGB_Green_PIN_D3      = 3;
  39. const uint8_t myRGBLED_LEDRGB_Blue_PIN_D4       = 4;
  40.  
  41. /***** DEFINITION OF OUTPUT RAW VARIABLES *****/
  42. /***** used to store raw data *****/
  43. bool    myRGBLED_LEDRGB_Red_PIN_D2_rawData      = 0;
  44. bool    myRGBLED_LEDRGB_Green_PIN_D3_rawData        = 0;
  45. bool    myRGBLED_LEDRGB_Blue_PIN_D4_rawData     = 0;
  46.  
  47. /***** DEFINITION OF OUTPUT PHYSICAL VARIABLES *****/
  48. /***** used to store data after characteristic curve transformation *****/
  49. float   myRGBLED_LEDRGB_Red_PIN_D2_phyData      = 0.0;
  50. float   myRGBLED_LEDRGB_Green_PIN_D3_phyData        = 0.0;
  51. float   myRGBLED_LEDRGB_Blue_PIN_D4_phyData     = 0.0;
  52.  
  53. void setup(void)
  54. {
  55.     // put your setup code here, to run once:
  56.     pinMode(myRGBLED_LEDRGB_Red_PIN_D2,  OUTPUT);
  57.     pinMode(myRGBLED_LEDRGB_Green_PIN_D3,    OUTPUT);
  58.     pinMode(myRGBLED_LEDRGB_Blue_PIN_D4,     OUTPUT);
  59. }
  60.  
  61. void loop(void)
  62. {
  63.     // put your main code here, to run repeatedly:
  64.     updateOutputs(); // Refresh output data
  65. }
  66.  
  67. void updateOutputs()
  68. {
  69.     digitalWrite(myRGBLED_LEDRGB_Red_PIN_D2, myRGBLED_LEDRGB_Red_PIN_D2_rawData);
  70.     digitalWrite(myRGBLED_LEDRGB_Green_PIN_D3, myRGBLED_LEDRGB_Green_PIN_D3_rawData);
  71.     digitalWrite(myRGBLED_LEDRGB_Blue_PIN_D4, myRGBLED_LEDRGB_Blue_PIN_D4_rawData);
  72. }
  73.  
  74. /* END CODE */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement