Is the circuit on
Correct to drive a car with 4*4 matrix keypad
And
Is this programme correct with this circuit for same purpose that is to drive car with matrix keypad:-
#include <avr/io.h>
void main(void)
{
unsigned int k, h;
DDRA=0x00;
DDRD=0XFF;
while (1)
{
k =~PINA;
h=k & 0x0F;
switch (h)
{
case 0x02:
{
PORTD=0x89;
break;
}
case 0x08:
{
PORTD=0x86;
break;
}
case 0x04:
{
PORTD=0x85;
break;
}
case 0x06:
{
PORTD=0x8A;
break;
}
case 0x05:
{
PORTD=0x00;
break;
}
}
}
}