# data[].attributes.body
void setup()

{

pinMode(2, OUTPUT); // set digital pin 13 to output

pinMode(3, OUTPUT); // set digital pin 13 to output

pinMode(4, OUTPUT); // set digital pin 13 to output

pinMode(5, OUTPUT); // set digital pin 13 to output

pinMode(6, OUTPUT); // set digital pin 13 to output

pinMode(7, OUTPUT); // set digital pin 13 to output

pinMode(8, OUTPUT); // set digital pin 13 to output

pinMode(9, OUTPUT); // set digital pin 13 to output

}

void loop()

{

digitalWrite(2, HIGH); // turn on digital pin 13 delay(500); // pause for one second

delay(500);

digitalWrite(2, LOW); // turn on digital pin 13 delay(500); // pause for one second

digitalWrite(3, HIGH); // turn on digital pin 13 delay(500); // pause for one second

delay(500);

digitalWrite(3, LOW); // turn on digital pin 13 delay(500); // pause for one second

digitalWrite(4, HIGH); // turn on digital pin 13 delay(500); // pause for one second

delay(500);

digitalWrite(4, LOW); // turn on digital pin 13 delay(500); // pause for one second

digitalWrite(5, HIGH); // turn on digital pin 13 delay(500); // pause for one second

delay(500);

digitalWrite(5, LOW); // turn on digital pin 13 delay(500); // pause for one second

digitalWrite(6, HIGH); // turn on digital pin 13 delay(500); // pause for one second

delay(500);

digitalWrite(6, LOW); // turn on digital pin 13 delay(500); // pause for one second

digitalWrite(7, HIGH); // turn on digital pin 13 delay(500); // pause for one second

delay(500);

digitalWrite(7, LOW); // turn on digital pin 13 delay(500); // pause for one second

digitalWrite(8, HIGH); // turn on digital pin 13 delay(500); // pause for one second

delay(500);

digitalWrite(8, LOW); // turn on digital pin 13 delay(500); // pause for one second

digitalWrite(9, HIGH); // turn on digital pin 13 delay(500); // pause for one second

delay(500);

digitalWrite(9, LOW); // turn on digital pin 13 delay(500); // pause for one second

digitalWrite(2, HIGH);

digitalWrite(3, HIGH);

digitalWrite(4, HIGH);

digitalWrite(5, HIGH);

digitalWrite(6, HIGH);

digitalWrite(7, HIGH);

digitalWrite(8, HIGH);

digitalWrite(9, HIGH);

delay(500);

digitalWrite(2, LOW);

digitalWrite(3, LOW);

digitalWrite(4, LOW);

digitalWrite(5, LOW);

digitalWrite(6, LOW);

digitalWrite(7, LOW);

digitalWrite(8, LOW);

digitalWrite(9, LOW);

delay(500);

digitalWrite(2, HIGH);

digitalWrite(3, HIGH);

digitalWrite(4, HIGH);

digitalWrite(5, HIGH);

digitalWrite(6, HIGH);

digitalWrite(7, HIGH);

digitalWrite(8, HIGH);

digitalWrite(9, HIGH);

delay(500);

digitalWrite(2, LOW);

digitalWrite(3, LOW);

digitalWrite(4, LOW);

digitalWrite(5, LOW);

digitalWrite(6, LOW);

digitalWrite(7, LOW);

digitalWrite(8, LOW);

digitalWrite(9, LOW);

}

# data[].attributes.body
// Define the LED pins

Int ledPins[] - (2, 3, 4, 5); // Pins where the LEDs are connecte

void setup() f

// Set each pin as an OUTPUT

Int i - 0; while (i < 4) (

pinMode(ledPins [#], OUTPUT);

i**;

｝

void loop() {

// Turn LEDs on

int i - 0; while (1 < 4) (

digitalwrite(ledPins[4], HIGH); // Turn each LED on delay (500); // Wait for 500ms i**;

}

// Turn LEDs off

1 - 6;

while (1 < 4)

{

digitalwrite(ledPins[1], LOw); // Turn each LED off delay(508); // Wait for 500ms

# data[].attributes.body
int ledPin1=3;
int ledPin2=5;
int ledPin3=6;
int ledPin4=9;
int ledPin5=10;
int ledPin6=11;

void setup() {
  // put your setup code here, to run once:
  pinMode(ledPin1, OUTPUT);
  pinMode(ledPin2, OUTPUT);
  pinMode(ledPin3, OUTPUT);
  pinMode(ledPin4, OUTPUT);
   pinMode(ledPin5, OUTPUT);
  pinMode(ledPin6, OUTPUT);

}

void loop() {
for (int brightness =0; brightness<=255; brightness++){
  analogWrite(ledPin1, brightness);
  analogWrite(ledPin2, 255 - brightness);
  analogWrite(ledPin3, brightness);
  analogWrite(ledPin4, 255 -brightness);
   analogWrite(ledPin5, brightness);
  analogWrite(ledPin6, 255 -brightness);
delay(10);

}

for (int brightness =255; brightness >=0; brightness--){
   analogWrite(ledPin1, 255 - brightness);
  analogWrite(ledPin2,  brightness);
  analogWrite(ledPin3,  255 - brightness);
  analogWrite(ledPin4,  brightness);
  analogWrite(ledPin5,  255 - brightness);
  analogWrite(ledPin6,  brightness);
  delay(10);
}
}

# data[].attributes.body
.
int ledPin=9;


void setup() {
  // put your setup code here, to run once:
pinMode(buttonPin, INPUT);
pinMode(pushPin, INPUT);
pinMode(ledPin, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
if (digitalRead(buttonPin) ==HIGH){
  digitalWrite(ledPin, HIGH);

}


if (digitalRead(pushPin ==LOW)){
  digitalWrite(ledPin, LOW);
}
}

# data[].attributes.body
int blue2 = 11;

int yellow = 10;

int green = 5;

int knob = A0;

void setup() {

pinMode(blue, OUTPUT);

pinMode(yellow, OUTPUT);

pinMode(green, OUTPUT);

pinMode(blue2, OUTPUT);

pinMode(knob, INPUT);

}

void loop() {

int potValue = analogRead(knob);

int brightness = map(potValue, 0, 1023, 0, 255);

analogWrite(blue, brightness);

analogWrite(blue2, brightness);

analogWrite(green, brightness);

analogWrite(yellow, brightness);

}

# data[].attributes.body
int blue2 = 11;

int yellow = 10;

int green = 5;

int knob = A0;

void setup() {

pinMode(blue, OUTPUT);

pinMode(yellow, OUTPUT);

pinMode(green, OUTPUT);

pinMode(blue2, OUTPUT);

pinMode(knob, INPUT);

}

void loop() {

int potValue = analogRead(knob);

int brightness = map(potValue, 0, 1023, 0, 255);

int low = map(potValue, 1023, 0, 0, 255); // Corrected this line

analogWrite(blue, brightness);

analogWrite(blue2, brightness);

analogWrite(green, low);

analogWrite(yellow, low);

}

# data[].attributes.body
#include <Keypad.h>

const byte ROWS = 4; // four rows
const byte COLS = 4; // four columns

// Define the symbols on the buttons of the keypad
char hexaKeys[ROWS][COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};

byte rowPins[ROWS] = {13, 12, 11, 10}; // Connect to the row pinouts of the keypad
byte colPins[COLS] = {9, 8, 7, 6}; // Connect to the column pinouts of the keypad

// Initialize an instance of the Keypad class
Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);

const String specialCode = "626"; // Code to turn on lights
const String stopCode = "000"; // Code to turn off lights

void setup() {
  Serial.begin(9600);
  pinMode(5, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(3, OUTPUT);
}

void loop() {
  String input = ""; // To collect user input
  while (input.length() < 3) { // Loop until 3 digits are entered
    char customKey = customKeypad.getKey();
    if (customKey) {
      Serial.print("Key Pressed: ");
      Serial.println(customKey);
      input += customKey; // Collect input

      // Immediate feedback for each key press
      if (input == specialCode) {
        Serial.println("Special Code Entered: All Lights On");
        digitalWrite(3, HIGH);
        digitalWrite(4, HIGH);
        digitalWrite(5, HIGH);
        return; // Exit loop and reset input
      } else if (input == stopCode) {
        Serial.println("Stop Code Entered: All Lights Off");
        digitalWrite(3, LOW);
        digitalWrite(4, LOW);
        digitalWrite(5, LOW);
        return; // Exit loop and reset input
      }
    }
  }

  // If 3 characters are entered without a match
  Serial.println("Input exceeded 3 characters. Resetting.");
}

# data[].attributes.body
#include <Keypad.h>

const byte ROWS = 4; // four rows
const byte COLS = 4; // four columns

// Define the symbols on the buttons of the keypad
char hexaKeys[ROWS][COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};

byte rowPins[ROWS] = {13, 12, 11, 10}; // Connect to the row pinouts of the keypad
byte colPins[COLS] = {9, 8, 7, 6}; // Connect to the column pinouts of the keypad

// Initialize an instance of the Keypad class
Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);

const String turnOnCode = "626"; // Code to turn on all lights
const String flashCode = "000"; // Code to make lights flash
const String wrongCode = "123"; // Code to turn off only one light

void setup() {
  Serial.begin(9600);
  pinMode(5, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(3, OUTPUT);
}

void loop() {
  String input = ""; // To collect user input
  while (input.length() < 3) { // Loop until 3 digits are entered
    char customKey = customKeypad.getKey();
    if (customKey) {
      Serial.print("Key Pressed: ");
      Serial.println(customKey);
      input += customKey; // Collect input

      // Check for code to turn on all lights
      if (input == turnOnCode) {
        Serial.println("Turn On Code Entered: All Lights On");
        digitalWrite(3, HIGH);
        digitalWrite(4, HIGH);
        digitalWrite(5, HIGH);
        return; // Exit loop and reset input
      }
      // Check for code to make lights flash
      else if (input == flashCode) {
        Serial.println("Flash Code Entered: Flashing Lights");
        flashLights(); // Call function to flash lights
        return; // Exit loop and reset input
      }
      // Check for wrong code to turn off only one light
      else if (input == wrongCode) {
        Serial.println("Wrong Code Entered: One Light Off");
        digitalWrite(3, LOW); // Turn off one specific light
        return; // Exit loop and reset input
      }
    }
  }

  // If 3 characters are entered without a match
  Serial.println("Input exceeded 3 characters. Resetting.");
}

// Function to flash the lights
void flashLights() {
  for (int i = 0; i < 10; i++) { // Flash 10 times
    digitalWrite(3, HIGH);
    digitalWrite(4, HIGH);
    digitalWrite(5, HIGH);
    delay(500); // Wait for half a second
    digitalWrite(3, LOW);
    digitalWrite(4, LOW);
    digitalWrite(5, LOW);
    delay(500); // Wait for half a second
  }
}

# data[].attributes.body
void setup() {

pinMode(ledPin, OUTPUT); // Set the LED pin as an output

digitalWrite(ledPin, HIGH); // Turn the LED on

}

void loop() {

// Nothing in the loop - LED stays on

}