资源描述:
《键盘调节参数lcd5110同步显示》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、#include/*commondefinesandmacros*/#include#pragmaLINK_INFODERIVATIVE"mc9s12xs128"#defineLCD_SCEPORTB_PB3#defineLCD_RSTPORTB_PB4#defineLCD_DCPORTB_PB2#defineLCD_SDINPORTB_PB1#defineLCD_SCLKPORTB_PB0#definekeyO1PORTA_PA1//#definekeyO2PORTA_PA2//#definekeyO3PORTA_PA
2、3//#definekeyI1PORTA_PA4//#definekeyI2PORTA_PA5//#definekeyI3PORTA_PA6//#definekeyI4PORTA_PA7//#definecom0#definedata1unsignedcharkeyout;unsignedcharkeycon;unsignedcharkeybit;unsignedcharkeybuf;unsignedchari=0;unsignedchartemp;unsignedlongintresult;unsignedcharenc03=103;unsignedcharmma7
3、260=88;unsignedcharspeed=50;unsignedcharspeed_p=100;unsignedcharspeed_i=200;unsignedcharangle_p=50;unsignedcharangle_d=100;unsignedchardirection_p=100;unsignedchardirection_d=50;unsignedcharge,shi,bai;floatAD_result[8];//存放AD转换结果unsignedcharlingpian;constcharshuzi[]={0x00,0x3E,0x51,0x49
4、,0x45,0x3E,//00x00,0x00,0x42,0x7F,0x40,0x00,//10x00,0x42,0x61,0x51,0x49,0x46,//20x00,0x21,0x41,0x45,0x4B,0x31,//30x00,0x18,0x14,0x12,0x7F,0x10,//40x00,0x27,0x45,0x45,0x45,0x39,//50x00,0x3C,0x4A,0x49,0x49,0x30,//60x00,0x01,0x71,0x09,0x05,0x03,//70x00,0x36,0x49,0x49,0x49,0x36,//80x00,0x06
5、,0x49,0x49,0x29,0x1E,//90x00,0x14,0x08,0x3E,0x08,0x14,//*10};constcharzimu[]={0x00,0x20,0x54,0x54,0x54,0x78,//a00x00,0x7F,0x48,0x44,0x44,0x38,//b10x00,0x38,0x44,0x44,0x44,0x20,//c20x00,0x38,0x44,0x44,0x48,0x7F,//d30x00,0x38,0x54,0x54,0x54,0x18,//e40x00,0x08,0x7E,0x09,0x01,0x02,//f50x00,
6、0x18,0xA4,0xA4,0xA4,0x7C,//g60x00,0x7F,0x08,0x04,0x04,0x78,//h70x00,0x00,0x44,0x7D,0x40,0x00,//i80x00,0x40,0x80,0x84,0x7D,0x00,//j90x00,0x7F,0x10,0x28,0x44,0x00,//k100x00,0x00,0x41,0x7F,0x40,0x00,//l110x00,0x7C,0x04,0x18,0x04,0x78,//m120x00,0x7C,0x08,0x04,0x04,0x78,//n130x00,0x38,0x44,0
7、x44,0x44,0x38,//o140x00,0xFC,0x24,0x24,0x24,0x18,//p150x00,0x18,0x24,0x24,0x18,0xFC,//q160x00,0x7C,0x08,0x04,0x04,0x08,//r170x00,0x48,0x54,0x54,0x54,0x20,//s180x00,0x04,0x3F,0x44,0x40,0x20,//t190x00,0x3C,0x40,0x40,0x20,0x7C,//u200x00,0x1C,0x20,0x40,0x20,0x1C,//v210x00,0x3C,0x40