AnsweredAssumed Answered

How can i program MC9S12E128's LCD and Push Buttons components C language?

Question asked by Rashad Nsouli on Nov 26, 2008
Latest reply on Nov 26, 2008 by Troy Smith
I'm supposed to program an LCD screen that outputs the a couple of names on it. The name changes each time the push buttons are pushed. This needs to be done with C language. I wrote this code so far but it seems to be wrong..

Code:
#include <hidef.h> /* common defines and macros */#include <mc9s12e128.h> /* derivative information */#include < stdio.h>#pragma LINK_INFO DERIVATIVE "SampleS12"void initPort(void);int main () {PORTB = 0x00;PORTA = 0x00;PORTE = 0X00;DDRA = 0XFF;DDRE = 0xFF;}void main (){char name1[8],name2[8],name3[8],name4[8];int input; EnableInterrupts;for(;;) { PORTE=0x01 ; DDRE = DDRA ;}char *name1 [8] = "Name1"; char *name2 [8] = "Name2" ;char *name3 [8] = "Name3";char *name4 [8] = "Name4" ;switch ( input ) {case 1: /* Note the colon, not a semicolon */PORTA: name1 break;case 2: PORTA : name2 break;case 3:PORTA ; name3 break;default: PORTA : name4break;}getchar();}}}}

Would really appreciate your help, any idea?
Thanks!

Outcomes