alaalwi11
Member level 1
- Joined
- Nov 30, 2010
- Messages
- 32
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,288
- Location
- Al khurtum-Sudan
- Activity points
- 1,626
hi gays,
i want to control in dc motor and h bridge using keypad
if i enter 1 motor move forword
and if ienter 2 the motor go reseve
and press 3 from keypad motor break
i begining my project by control in leds using keypad

i want to control in dc motor and h bridge using keypad
if i enter 1 motor move forword
and if ienter 2 the motor go reseve
and press 3 from keypad motor break
i begining my project by control in leds using keypad
char keypadPort at PORTD;
unsigned char keyPress;
unsigned char keyValue;
void main() {
TRISB=0X00;
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
