I'm supposed to program an LCD screen in MC9S12E128 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..
PHP 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 : name4
break;
}
getchar();
}
}
}
}
The debugger tells me that Return is Expected n stuff, any idea what could be wrong with my code? Would really appreciate your help..
Thanks!