CCCPaste

FirstSignUp 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: FirstSignUp
	- Source Code compiled for: Arduino Uno
	- Source Code created on: 2023-10-21 08:16:57
	- Source Code generated by: khan

********* Pleasedontcode.com **********/
/****** DEFINITION OF LIBRARIES *****/
#include 

/****** SYSTEM REQUIREMENT 1 *****/
/* Turn Light Automatically when it goes off */

/****** FUNCTION PROTOTYPES *****/
void setup(void);
void loop(void);
void turnOnLight(void);
void turnOffLight(void);

/***** DEFINITION OF DIGITAL OUTPUT PINS *****/
const uint8_t myled_LED_PIN_D2 = 2;
const uint8_t myled_LED_PIN_D3 = 3;

bool isLightOn = false;

void setup(void)
{
  // Initialize the digital output pins
  pinMode(myled_LED_PIN_D2, OUTPUT);
  pinMode(myled_LED_PIN_D3, OUTPUT);
}

void loop(void)
{
  // Check if the light is off
  if (!isLightOn)
  {
    // Turn on the light
    turnOnLight();
    isLightOn = true;
  }
  else
  {
    // Turn off the light
    turnOffLight();
    isLightOn = false;
  }

  // Delay for 1 second
  delay(1000);
}

void turnOnLight(void)
{
  // Set the digital output pins to HIGH to turn on the light
  digitalWrite(myled_LED_PIN_D2, HIGH);
  digitalWrite(myled_LED_PIN_D3, HIGH);
}

void turnOffLight(void)
{
  // Set the digital output pins to LOW to turn off the light
  digitalWrite(myled_LED_PIN_D2, LOW);
  digitalWrite(myled_LED_PIN_D3, LOW);
}