calculator

hello :slight_smile: :slight_smile: :slight_smile:
I want to the keyboard 4* 4to micro and its outcome lcd on display .
and the figure behind to show
and I'm going to scan the availment of my
This code :

#include <mega32.h>
#include <delay.h>

unsigned char key; 

void main(void)
{
while(1)
      { 
      do{
      
     DDRA = 0x0f;
       PORTA = 0xf0; 
       delay_us(100);
       key = PINA;
        
     
       DDRA = 0xf0;
       PORTA = 0x0f; 
       delay_us(100);
       key = key | PINA;
     
     }while(key==0xff);
    
     
        
       
          switch(key)
    {
        case 0b11101110:    
        key=1;
        break;
        case 0b11011110:    
        key=2;
        break;
        case 0b10111110:   
        key=3;
        break;
        case 0b01111110:    
        key=4;
        break;
        case 0b11101101:    
        key=5;
        break;
        case 0b11011101:    
        key=6;
        break;
        case 0b10111101:    
        key=7;
        break;
        case 0b01111101:   
        key=8;
        break;
        case 0b11101011:    
        key=9;
        break;
        case 0b11011011:    
        key=10;
        break;
        case 0b10111011:    
        key=11;
        break;
        case 0b01111011:    
        key=12;
        break;
        case 0b11100111:    
        key=13;
        break;
        case 0b11010111:    
        key=14;
        break;
        case 0b10110111:    
        key=15;
        break;
        case 0b01110111:    
        key=16;
        
    }
}
}