zia.newversion
Member level 5
Alright pals. Here is my code.
I am using MikroC for PIC IDE and the keypad library included in the package.
Here is the circuit diagram that I am using in Labcenter Proteus 7.6 for simulation of my code.
**broken link removed**
But this circuit is not working. I am at loss as to where the problem lies, the code or the connections. If someone knows please help me out. I shall be greatly thankful!
Code:
char keypadPort at PORTD;
unsigned char keyPress;
unsigned char keyValue;
void main() {
Keypad_Init();
keyPress = 0x00;
keyValue = 0x00;
do
keyPress = Keypad_Key_Click();
while (keyPress != 0);
switch(keyPress)
{
case 1: keyValue = 0x01; break;
case 2: keyValue = 0x02; break;
case 3: keyValue = 0x03; break;
case 4: keyValue = 0x04; break;
case 5: keyValue = 0x05; break;
case 6: keyValue = 0x06; break;
case 7: keyValue = 0x07; break;
case 8: keyValue = 0x08; break;
case 9: keyValue = 0x09; break;
case 10: keyValue = 0x0A; break;
case 11: keyValue = 0x00; break;
case 12: keyValue = 0x0C; break;
}
PORTB = keyValue;
}
I am using MikroC for PIC IDE and the keypad library included in the package.
Here is the circuit diagram that I am using in Labcenter Proteus 7.6 for simulation of my code.
**broken link removed**
But this circuit is not working. I am at loss as to where the problem lies, the code or the connections. If someone knows please help me out. I shall be greatly thankful!