Documente Academic
Documente Profesional
Documente Cultură
C- CODE:
/* ALWAYS INCLUDE THESE LINES OF CODE */
#include <hidef.h>
/* common defines and macros */
#include <mc9s12dt256.h> /* derivative information */
#include "pbs12dslk.h" /* I/O definitions and init routines */
#include "lcd.h"
/* LCD definitions and init routines */
#pragma LINK_INFO DERIVATIVE "mc9s12dt256"
/* END ALWAYS INCLUDE THESE LINES OF CODE */
#define _P(ADDRESS) *(unsigned char volatile *)(ADDRESS)
/* Global Variables */
long int count = 1;
int divisor = 0;
int LCD_refresh = 5;
int LED_SPEED = 100;
/* End Global Variables */
void main(void){
unsigned char a[]=" Do not feed the ELVIS";
int j,i,k,y,z;
int b;
LCDInit();
for(i=0;i<21;i++){
j=i*sizeof(unsigned char);
_P(0x3F3F+j) = a[i];
}
do{
b=0;
LCDClearDisplay();
for(k=0;k<22;k++,b++){
if (k%8==0) {
LCDClearDisplay();
}
j = b * sizeof(unsigned char);
LCDPutChar(_P(0x3F3F+j));
if (k % 8 == 7 || k==21) {
for(y=0;y<500;y++){
for(z=0;z<500;z++){}
}
}
}
}while(1);
}