1. ibrahim hassan

    Thread Starter New Member

    Mar 9, 2010
    3
    0
    i want to test something and here is my code ' am using mikro C '

    unsigned short kpi ;
    char txt[5];
    void main() {
    TRISB=0X00;
    TRISA=0XFF;
    PORTB=0;
    Keypad_Init(&PORTC);
    while (1) {
    do {
    kpi = 0;
    do
    kpi = Keypad_Released();
    while (!kpi);
    switch (kpi) {
    case 1: kpi = '1'; break;
    case 2: kpi = '2'; break;
    case 3: kpi = '3'; break;
    case 4: kpi = 'A'; break;
    case 5: kpi = '4'; break;
    case 6: kpi = '5'; break;
    case 7: kpi = '6'; break;
    case 8: kpi = 'B'; break;
    case 9: kpi = '7'; break;
    case 10: kpi = '8'; break;
    case 11: kpi = '9'; break;
    case 12: kpi = 'C'; break;
    case 13: kpi = '*'; break;
    case 14: kpi = '0'; break;
    case 15: kpi = '#'; break;
    case 16: kpi = 'D'; break;
    }
    if(kpi == 1)
    {
    PORTB.F1=1;
    }
    }
    }
    }

    i keep getting errors and i dont know whats wornd with the code
    please help
     
Loading...