//10 //Press 1st switch & Glow 5th LED
// Press 4th switch &
// Press 7th switch &
// Press 5th switch
// One by One
// Press 4th switch & OFF 5th LED
// Press 7th switch &
// Press 6th switch &
// Press 8th switch &
//One by One
// void setup(){
// volatile long i,j;
// volatile char *dirf = (char*)0x30; // DDRF data direction register of portf
// volatile char *dirk = (char*)0x107; // DDRK data direction register port k
// volatile char *outf = (char*)0x31; // PORTF – Port F Data Register
// volatile char *ink = (char*)0x106 ; // PINK – Port K Input Pins Address
// *dirf = 0xff; // configure portf as output
// *dirk = 0x00; // configure portk as input receive data from switch
// volatile char x,count=1;
// while(1){
// x = *ink;
// if((x & 0x01)==0x01) // press 1st switch
// {
// *outf = 0x20; // glow led
// for(i=0;i<500000;i++);
// }
// if((x & 0x08)==0x08 && count == 1 ) // press 4th switch
// {
// *outf = 0x00; // 0ff led
// for(i=0;i<500000;i++);
// count++;
// }
// // for(i=0;i<500000;i++);
// if((x & 0x08)==0x08 ) // press 4st switch
// {
// *outf = 0x20; // glow led
// for(i=0;i<500000;i++);
// }
// if((x & 0x40)==0x40) // press 7th switch
// {
// *outf = 0x00; // off led
// for(i=0;i<500000;i++);
// }
// }
// }
/*
//9. Press 1st switch Press 4th switch & Press 7th switch & Press 9th
//switch One by One & Glow 8th LED for 10 seconds
void setup(){
volatile long i,j;
volatile char *dirf = (char*)0x30; // DDRF data direction register of portf
volatile char *dirk = (char*)0x107; // DDRK data direction register port k
volatile char *outf = (char*)0x31; // PORTF – Port F Data Register
volatile char *ink = (char*)0x106 ; // PINK – Port K Input Pins Address
*dirf = 0xff; // configure portf as output
*dirk = 0x00; // configure portk as input receive data from switch
volatile char arr[]={0x01,0x08,0x40};
volatile char x;
while(1){
x = *ink;
if((x & 0x01)==0x01)
{
*outf = 0x80;
for(i=0;i<5000000;i++); // 30seconds
*outf = 0X00;
}
else if((x & 0x08) ==0x08)
{
*outf = 0x80;
for(i=0;i<5000000;i++); // 30seconds
*outf = 0X00;
}
else if((x & 0x40) ==0x40)
{
*outf = 0x80;
for(i=0;i<5000000;i++); // 30seconds
*outf = 0X00;
}
}
}
*/
/*
// not done
//.8 Press 1st switch 7th switch Together& Glow 5th LED for 30 secondsPress
void setup(){
volatile long i,j;
volatile char *dirf = (char*)0x30; // DDRF data direction register of portf
volatile char *dirk = (char*)0x107; // DDRK data direction register port k
volatile char *outf = (char*)0x31; // PORTF – Port F Data Register
volatile char *ink = (char*)0x106 ; // PINK – Port K Input Pins Address
*dirf = 0xff; // configure portf as output
*dirk = 0x00; // configure portk as input receive data from switch
volatile char x;
while(1){
x = *ink;
if((x & 0x01 ==0x01) && (x & 0x40 ==0x40)) {
{
*outf = 0x20;
for(i=0;i<10000000;i++); // 30seconds
*outf = 0X00;
}
}
}
}
*/
/*//Press 7th switch first glow 5th LED, delay,
//3rd LED, delay, 0th LED,delay,1st LED
void setup(){
volatile long i,j;
volatile char *dirf = (char*)0x30; // DDRF data direction register of portf
volatile char *dirk = (char*)0x107; // DDRK data direction register port k
volatile char *outf = (char*)0x31; // PORTF – Port F Data Register
volatile char *ink = (char*)0x106 ; // PINK – Port K Input Pins Address
*dirf = 0xff; // configure portf as output
*dirk = 0x00; // configure portk as input receive data from switch
volatile char x;
while(1){
x = *ink;
if((x & 0x80)==0x80) //
{
*outf = 0x20;
for(i=0;i<500000;i++);
*outf = 0x28;
for(i=0;i<500000;i++);
*outf = 0x29;
for(i=0;i<500000;i++);
*outf = 0x2B; // 15
for(i=0;i<500000;i++);
}
}
}
*/
/*
//6. Press 2nd switch first glow 3rd LED, delay,
//5th LED, delay, 7th LED,
//delay,6th LED
void setup(){
volatile long i,j;
volatile char *dirf = (char*)0x30; // DDRF data direction register of portf
volatile char *dirk = (char*)0x107; // DDRK data direction register port k
volatile char *outf = (char*)0x31; // PORTF – Port F Data Register
volatile char *ink = (char*)0x106 ; // PINK – Port K Input Pins Address
*dirf = 0xff; // configure portf as output
*dirk = 0x00; // configure portk as input receive data from switch
volatile char x;
while(1){
x = *ink;
if((x & 0x02)==0x02) //
{
*outf = 0x08;
for(i=0;i<500000;i++);
*outf = 0x28;
for(i=0;i<500000;i++);
*outf = 0xA8;
for(i=0;i<500000;i++);
*outf = 0xE8; // 15
for(i=0;i<500000;i++);
}
}
}
*/
/*
//Press 3rd switch first glow 7th LED, delay,
//6th LED, delay, 3rd LED,
//delay,2nd LED
void setup(){
volatile long i,j;
volatile char *dirf = (char*)0x30; // DDRF data direction register of portf
volatile char *dirk = (char*)0x107; // DDRK data direction register port k
volatile char *outf = (char*)0x31; // PORTF – Port F Data Register
volatile char *ink = (char*)0x106 ; // PINK – Port K Input Pins Address
*dirf = 0xff; // configure portf as output
*dirk = 0x00; // configure portk as input receive data from switch
volatile char x;
while(1){
x = *ink;
if((x & 0x04)==0x04) //
{
*outf = 0x80;
for(i=0;i<500000;i++);
*outf = 0x40;
for(i=0;i<500000;i++);
*outf = 0x08;
for(i=0;i<500000;i++);
*outf = 0x04; // 15
for(i=0;i<500000;i++);
}
}
}
*/
/*
//4. Press 7th switch first glow 0th LED, delay,1st LED, Delay, 4th LED,
//elay,7th LED
void setup(){
volatile long i,j;
volatile char *dirf = (char*)0x30; // DDRF data direction register of portf
volatile char *dirk = (char*)0x107; // DDRK data direction register port k
volatile char *outf = (char*)0x31; // PORTF – Port F Data Register
volatile char *ink = (char*)0x106 ; // PINK – Port K Input Pins Address
*dirf = 0xff; // configure portf as output
*dirk = 0x00; // configure portk as input receive data from switch
volatile char x;
while(1){
x = *ink;
if((x & 0x80)==0x80) //
{
*outf = 0x01;
for(i=0;i<500000;i++);
*outf = 0x03;
for(i=0;i<500000;i++);
*outf = 0x13;
for(i=0;i<500000;i++);
*outf = 0x93; // 15
for(i=0;i<500000;i++);
}
}
}
*/
/*
//3. Press 2nd switch glow 0th LED, delay,1St LED, delay,
//5th LED, delay,6th LED
void setup(){
volatile long i,j;
volatile char *dirf = (char*)0x30; // DDRF data direction register of portf
volatile char *dirk = (char*)0x107; // DDRK data direction register port k
volatile char *outf = (char*)0x31; // PORTF – Port F Data Register
volatile char *ink = (char*)0x106 ; // PINK – Port K Input Pins Address
*dirf = 0xff; // configure portf as output
*dirk = 0x00; // configure portk as input receive data from switch
volatile char x;
while(1){
x = *ink;
if((x & 0x04)==0x04) //
{
*outf = 0x01;
for(i=0;i<500000;i++);
*outf = 0x03;
for(i=0;i<500000;i++);
*outf = 0x23;
for(i=0;i<500000;i++);
*outf = 0x63; // 15
for(i=0;i<500000;i++);
}
}
}
*/
/*
//2. Press 3rd switch first glow 3rd LED, delay,
//1st LED, delay, 7th LED,
//delay,4th LED
void setup(){
volatile long i,j;
volatile char *dirf = (char*)0x30; // DDRF data direction register of portf
volatile char *dirk = (char*)0x107; // DDRK data direction register port k
volatile char *outf = (char*)0x31; // PORTF – Port F Data Register
volatile char *ink = (char*)0x106 ; // PINK – Port K Input Pins Address
*dirf = 0xff; // configure portf as output
*dirk = 0x00; // configure portk as input receive data from switch
volatile char x;
while(1){
x = *ink;
if((x & 0x08)==0x08) //
{
*outf = 0x08;
for(i=0;i<500000;i++);
*outf = 0x0A;
for(i=0;i<500000;i++);
*outf = 0x8A;
for(i=0;i<500000;i++);
*outf = 0x9A; // 15
for(i=0;i<500000;i++);
}
}
}
*/
/*
//1. Press 2nd switch first glow 1st LED, delay,
//2nd LED, delay, 5th LED,
//delay,6th LED
void setup(){
volatile long i,j;
volatile char *dirf = (char*)0x30; // DDRF data direction register of portf
volatile char *dirk = (char*)0x107; // DDRK data direction register port k
volatile char *outf = (char*)0x31; // PORTF – Port F Data Register
volatile char *ink = (char*)0x106 ; // PINK – Port K Input Pins Address
*dirf = 0xff; // configure portf as output
*dirk = 0x00; // configure portk as input receive data from switch
volatile char x;
while(1){
x = *ink;
if((x & 0x02)==0x02) //
{
*outf = 0x02;
for(i=0;i<500000;i++);
*outf = 0x06;
for(i=0;i<500000;i++);
*outf = 0x26;
for(i=0;i<500000;i++);
*outf = 0x66; // 15
for(i=0;i<500000;i++);
}
}
}
*/