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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
1,973 次查看
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!
标签 (1)
标记 (1)
0 项奖励
回复
1 解答
819 次查看
Destroy
Contributor II
It looks like you are trying to write in a BASIC style.  Try Reading this C Code how to.
 
 
 

在原帖中查看解决方案

0 项奖励
回复
1 回复
820 次查看
Destroy
Contributor II
It looks like you are trying to write in a BASIC style.  Try Reading this C Code how to.
 
 
 
0 项奖励
回复