|
#include<reg51.h>
#include"mouse.h"
#include"lcd.h"
#define uint unsigned int
#define uchar unsigned char
uint a,i;
unsigned char code make[]="key: z=0000";
uchar dat;
void main()
{
Init_mouse();
LcdInit();
mouse_send_data(0xf4);
EX1=0;
delayms(100);
EX1=1;
LcdWriteCom(0x80);
LcdWriteData('x');
LcdWriteData('=');
LcdWriteCom(0x88);
LcdWriteData('y');
LcdWriteData('=');
LcdWriteCom(0xc0);
for(i=16;i>0;i--)
{
LcdWriteData(make[i]);
}
while(1)
{
mouse_send_data(dat);
data_analyse();
LcdWriteCom(0x82);
LcdWriteData('0'+move_x/10000);
LcdWriteData('0'+(move_x%10)/1000);
LcdWriteData('0'+(move_x%100)/100);
LcdWriteData('0'+(move_x%1000)/10);
LcdWriteData('0'+move_x%10000);
LcdWriteCom(0x88);
LcdWriteData('0'+move_y/10000);
LcdWriteData('0'+(move_y%10)/1000);
LcdWriteData('0'+(move_y%100)/100);
LcdWriteData('0'+(move_y%1000)/10);
LcdWriteData('0'+move_y%10000);
if(mouse_byte_bit&0x01)
{
LcdWriteCom(0xc4);
LcdWriteData('L');
}
else if(mouse_byte_bit&0x02)
{
LcdWriteCom(0xc4);
LcdWriteData('R');
}
else if(mouse_byte_bit&0x04)
{
LcdWriteCom(0xc4);
LcdWriteData('M');
}
else
{
LcdWriteCom(0xc4);
LcdWriteData('w');
}
a=mouse_data[3];
LcdWriteCom(0xc8);
LcdWriteData('0'+a/10000);
LcdWriteData('0'+(a%10)/1000);
LcdWriteData('0'+(a%100)/100);
LcdWriteData('0'+(a%1000)/10);
LcdWriteData('0'+a%10000);
}
}
Build target 'Target 1'
assembling STARTUP.A51...
compiling shubiao.c...
C51 FATAL-ERROR -
ACTION: PARSING SOURCE-FILE
ERROR: PREPROCESSOR: MACROS TOO NESTED
C51 TERMINATED.
Target not created
|
|