CCCPaste

Digital Pins rev_01

/********* 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: Digital Pins
	- Source Code NOT compiled for: Arduino Uno
	- Source Code created on: 2024-04-22 00:00:04

********* Pleasedontcode.com **********/

/****** SYSTEM REQUIREMENTS *****/
/****** SYSTEM REQUIREMENT 1 *****/
	/* The system will be activated when the user enters */
	/* a value x from the serial monitor or clicks on the */
	/* first push button. */
/****** SYSTEM REQUIREMENT 2 *****/
	/* The system will be deactivated if the user press */
	/* on the second push button. */
/****** END SYSTEM REQUIREMENTS *****/

/****** DEFINITION OF LIBRARIES *****/

/****** FUNCTION PROTOTYPES *****/
void setup(void);
void loop(void);
void updateOutputs(void);

/***** DEFINITION OF DIGITAL INPUT PINS *****/
const uint8_t push_PushButton_PIN_D2      = 2;
const uint8_t Tem_DS18B20_DQ_PIN_D6       = 6;

/***** DEFINITION OF DIGITAL OUTPUT PINS *****/
const uint8_t led_LEDRGB_Red_PIN_D3       = 3;
const uint8_t led_LEDRGB_Green_PIN_D4     = 4;
const uint8_t led_LEDRGB_Blue_PIN_D5      = 5;

/***** DEFINITION OF OUTPUT RAW VARIABLES *****/
/***** used to store raw data *****/
bool    led_LEDRGB_Red_PIN_D3_rawData     = 0;
bool    led_LEDRGB_Green_PIN_D4_rawData   = 0;
bool    led_LEDRGB_Blue_PIN_D5_rawData    = 0;

/***** DEFINITION OF OUTPUT PHYSICAL VARIABLES *****/
/***** used to store data after characteristic curve transformation *****/
float   led_LEDRGB_Red_PIN_D3_phyData     = 0.0;
float   led_LEDRGB_Green_PIN_D4_phyData   = 0.0;
float   led_LEDRGB_Blue_PIN_D5_phyData    = 0.0;

void setup(void)
{
    // put your setup code here, to run once:

    pinMode(push_PushButton_PIN_D2,    INPUT_PULLUP);
    pinMode(Tem_DS18B20_DQ_PIN_D6,     INPUT);

    pinMode(led_LEDRGB_Red_PIN_D3,     OUTPUT);
    pinMode(led_LEDRGB_Green_PIN_D4,   OUTPUT);
    pinMode(led_LEDRGB_Blue_PIN_D5,    OUTPUT);

}


void loop(void)
{
    // put your main code here, to run repeatedly:

    updateOutputs(); // Refresh output data

}

void updateOutputs()
{
    digitalWrite(led_LEDRGB_Red_PIN_D3, led_LEDRGB_Red_PIN_D3_rawData);
    digitalWrite(led_LEDRGB_Green_PIN_D4, led_LEDRGB_Green_PIN_D4_rawData);
    digitalWrite(led_LEDRGB_Blue_PIN_D5, led_LEDRGB_Blue_PIN_D5_rawData);
}

/* END CODE */