Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /********* Pleasedontcode.com **********
- Pleasedontcode thanks you for automatic code generation! Enjoy your code!
- - Terms and Conditions:
- You have a non-exclusive, revocable, worldwide, royalty-free license
- for personal and commercial use. Attribution is optional; modifications
- are allowed, but you're responsible for code maintenance. We're not
- liable for any loss or damage. For full terms,
- please visit pleasedontcode.com/termsandconditions.
- - Project: "RGB Control"
- - Source Code NOT compiled for: Arduino Uno
- - Source Code created on: 2024-06-21 13:24:49
- ********* Pleasedontcode.com **********/
- /****** SYSTEM REQUIREMENTS *****/
- /****** SYSTEM REQUIREMENT 1 *****/
- /* Do all the above */
- /****** END SYSTEM REQUIREMENTS *****/
- /****** DEFINITION OF LIBRARIES *****/
- #include <Arduino.h>
- /****** FUNCTION PROTOTYPES *****/
- void setup(void);
- void loop(void);
- void updateOutputs(void);
- /***** DEFINITION OF DIGITAL OUTPUT PINS *****/
- const uint8_t asd_LEDRGB_Red_PIN_D2 = 2;
- const uint8_t asd_LEDRGB_Green_PIN_D3 = 3;
- const uint8_t asd_LEDRGB_Blue_PIN_D4 = 4;
- /***** DEFINITION OF OUTPUT RAW VARIABLES *****/
- /***** used to store raw data *****/
- bool asd_LEDRGB_Red_PIN_D2_rawData = 0;
- bool asd_LEDRGB_Green_PIN_D3_rawData = 0;
- bool asd_LEDRGB_Blue_PIN_D4_rawData = 0;
- /***** DEFINITION OF OUTPUT PHYSICAL VARIABLES *****/
- /***** used to store data after characteristic curve transformation *****/
- float asd_LEDRGB_Red_PIN_D2_phyData = 0.0;
- float asd_LEDRGB_Green_PIN_D3_phyData = 0.0;
- float asd_LEDRGB_Blue_PIN_D4_phyData = 0.0;
- void setup(void)
- {
- // put your setup code here, to run once:
- pinMode(asd_LEDRGB_Red_PIN_D2, OUTPUT);
- pinMode(asd_LEDRGB_Green_PIN_D3, OUTPUT);
- pinMode(asd_LEDRGB_Blue_PIN_D4, OUTPUT);
- }
- void loop(void)
- {
- // put your main code here, to run repeatedly:
- updateOutputs(); // Refresh output data
- }
- void updateOutputs()
- {
- // Update the physical data based on raw data
- asd_LEDRGB_Red_PIN_D2_phyData = asd_LEDRGB_Red_PIN_D2_rawData ? 255.0 : 0.0;
- asd_LEDRGB_Green_PIN_D3_phyData = asd_LEDRGB_Green_PIN_D3_rawData ? 255.0 : 0.0;
- asd_LEDRGB_Blue_PIN_D4_phyData = asd_LEDRGB_Blue_PIN_D4_rawData ? 255.0 : 0.0;
- // Write the physical data to the digital pins
- analogWrite(asd_LEDRGB_Red_PIN_D2, asd_LEDRGB_Red_PIN_D2_phyData);
- analogWrite(asd_LEDRGB_Green_PIN_D3, asd_LEDRGB_Green_PIN_D3_phyData);
- analogWrite(asd_LEDRGB_Blue_PIN_D4, asd_LEDRGB_Blue_PIN_D4_phyData);
- }
- /* END CODE */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement