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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
1,484 Views
DrDiablo
Contributor I
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!
Labels (1)
Tags (1)
0 Kudos
1 Solution
330 Views
Destroy
Contributor II
It looks like you are trying to write in a BASIC style.  Try Reading this C Code how to.
 
 
 

View solution in original post

0 Kudos
1 Reply
331 Views
Destroy
Contributor II
It looks like you are trying to write in a BASIC style.  Try Reading this C Code how to.
 
 
 
0 Kudos