Interface Arduino Unowith CD4094

I am trying to Interface arduino UNo with CD4094. I need simple c code without using library where i can turn on the below cases

case1: All LED will be On

case 2: all led will be off

case 3: all led flicker with 1s delay

case 4 : if led 1 is on other led should be OFF, If led 2 is on other all LED sould be off. can some one suggest simple c code for implement

#define LED1 pinNumber; //Here we give each led a pin number
#define LED2 pinNumber; //You must delete "pinNumber" and insert the nember where your LEDs will connect
#define LED3 pinNumber;
#define LED4 pinNumber;
//etc...

int Case1; //Here we create 3 variables
int Case2;
int Case3;

if(Case1 == 1)
{
digitalWrite(LED1, HIGH);
digitalWrite(LED2, HIGH);
digitalWrite(LED3, HIGH);
digitalWrite(LED4, HIGH);
}

else if(Case2 == 1)
{
digitalWrite(LED1, LOW);
digitalWrite(LED2, LOW);
digitalWrite(LED3, LOW);
digitalWrite(LED4, LOW);
}
else if(Case3 == 1)
{
digitalWrite(LED1, HIGH);
digitalWrite(LED2, HIGH);
digitalWrite(LED3, HIGH);
digitalWrite(LED4, HIGH);
delay(1000); //This line gives a delay of 1000ms = 1s
digitalWrite(LED1, LOW);
digitalWrite(LED2, LOW);
digitalWrite(LED3, LOW);
digitalWrite(LED4, LOW);
delay(1000);
}
while(Case3 == 1) //Cicle while will keep this statement running, making the LEDs switch ON/OFF with 1s delay

if (LED1 == HIGH)
{
digitalWrite(LED2, LOW);
digitalWrite(LED3, LOW);
digitalWrite(LED4, LOW);
}

if (LED2 == HIGH)
{
digitalWrite(LED1, LOW);
digitalWrite(LED3, LOW);
digitalWrite(LED4, LOW);
}

You should try to make this code on your own, it isn't that much demanding.

Visit the Arduino reference for more information
https://www.arduino.cc/reference/en/

@AJITnayak, this is the same question as in your other Thread. With 1773 posts you have been around long enough to know not to double post.

Please click Report to Moderator and ask to have the two Threads merged.

...R

i know code also written assigning individual digital pin. I want to reduce pin so i am using serial shift register IC . but i dont know how to use it

void ShiftData(unsigned char Data)
{
unsigned char i;
OUTEN=1;
STROBE = 0;
DISPCLK = 0;
DISPDATA = 0;

for(i = 0;i < 8;i++)
{
if(Data & 0x01)
DISPDATA = 1;
else
DISPDATA = 0;

DISPCLK = 1;
NOP();
NOP();
DISPCLK = 0;
Data = Data >> 1;

}
STROBE = 1;
NOP();
NOP();
STROBE = 0;
OUTEN=0;
}