You are on page 1of 5

MICROPROCESSOR

EXPERIMENT NO. 1 : Blinking Lights


Connection:

PART A
Coding:
int digitalWrite(led2,HIGH);
led1=2,led2=3,led3=4,led4=5,led5=6,led6=7
digitalWrite(led3,HIGH);
;
digitalWrite(led4,HIGH);
void setup()
digitalWrite(led5,HIGH);
{
digitalWrite(led6,HIGH);
pinMode(led1,OUTPUT);
delay(500);
pinMode(led2,OUTPUT);
digitalWrite(led1,LOW);
pinMode(led3,OUTPUT);
digitalWrite(led2,LOW);
pinMode(led4,OUTPUT);
digitalWrite(led3,LOW);
pinMode(led5,OUTPUT);
digitalWrite(led4,LOW);
pinMode(led6,OUTPUT);
digitalWrite(led5,LOW);
}
digitalWrite(led6,LOW);
void loop()
delay(500);
{
}
digitalWrite(led1,HIGH);
MICROPROCESSOR

PART B
Coding:
int digitalWrite(led4,HIGH);
led1=2,led2=3,led3=4,led4=5,led5=6,led6=7
delay(500);
;
digitalWrite(led5,HIGH);
void setup()
delay(500);
{
digitalWrite(led6,HIGH);
pinMode(led1,OUTPUT);
delay(500);
pinMode(led2,OUTPUT);
digitalWrite(led6,LOW);
pinMode(led3,OUTPUT);
delay(500);
pinMode(led4,OUTPUT);
digitalWrite(led5,LOW);
pinMode(led5,OUTPUT);
delay(500);
pinMode(led6,OUTPUT);
digitalWrite(led4,LOW);
}
delay(500);
void loop()
digitalWrite(led3,LOW);
{
delay(500);
digitalWrite(led1,HIGH);
digitalWrite(led2,LOW);
delay(500);
delay(500);
digitalWrite(led2,HIGH);
digitalWrite(led1,LOW);
delay(500);
delay(500);
digitalWrite(led3,HIGH);
delay(500);
}
MICROPROCESSOR

PART C
Coding:
int digitalWrite(led2,HIGH);
led1=2,led2=3,led3=4,led4=5,led5=6,led6=7
digitalWrite(led3,LOW);
;
digitalWrite(led4,HIGH);
void setup()
digitalWrite(led5,LOW);
{
digitalWrite(led6,HIGH);
pinMode(led1,OUTPUT);
delay(500);
pinMode(led2,OUTPUT);
digitalWrite(led1,HIGH);
pinMode(led3,OUTPUT);
digitalWrite(led2,LOW);
pinMode(led4,OUTPUT);
digitalWrite(led3,HIGH);
pinMode(led5,OUTPUT);
digitalWrite(led4,LOW);
pinMode(led6,OUTPUT);
digitalWrite(led5,HIGH);
}
digitalWrite(led6,LOW);
void loop()
delay(500);
{
}
digitalWrite(led1,LOW);
MICROPROCESSOR

PART D
Coding:
int digitalWrite(led6,LOW);
led1=2,led2=3,led3=4,led4=5,led5=6,led6=7
delay(500);
;
digitalWrite(led1,LOW);
void setup()
digitalWrite(led2,LOW);
{
digitalWrite(led3,HIGH);
pinMode(led1,OUTPUT);
digitalWrite(led4,HIGH);
pinMode(led2,OUTPUT);
digitalWrite(led5,LOW);
pinMode(led3,OUTPUT);
digitalWrite(led6,LOW);
pinMode(led4,OUTPUT);
delay(500);
pinMode(led5,OUTPUT);
digitalWrite(led1,LOW);
pinMode(led6,OUTPUT);
digitalWrite(led2,HIGH);
}
digitalWrite(led3,LOW);
void loop()
digitalWrite(led4,LOW);
{
digitalWrite(led5,HIGH);
digitalWrite(led1,HIGH);
digitalWrite(led6,LOW);
digitalWrite(led2,LOW);
delay(500);
digitalWrite(led3,LOW);
digitalWrite(led4,LOW);
digitalWrite(led5,LOW);
digitalWrite(led6,HIGH);
delay(500);
digitalWrite(led1,LOW);
digitalWrite(led2,HIGH);
digitalWrite(led3,LOW);
digitalWrite(led4,LOW);
digitalWrite(led5,HIGH);
MICROPROCESSOR