1
完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
..SOURSELCD12864.H(4): error C141: syntax error near 'dat', expected ')' ..SOURSELCD12864.H(6): error C141: syntax error near 'com', expected ')' ..SOURSELCD12864.H(7): error C141: syntax error near 'dat', expected ')' ..SOURSELCD12864.H(8): error C141: syntax error near 'x', expected ')' ..SOURSELCD12864.H(9): error C141: syntax error near 'x', expected ')' H代码 #ifndef __LCD12864_H #define __LCD12864_H void Set_byte(u8 dat); void Busy(); void Writer_com(u8 com); void Writer_dat(u8 dat); void Writer_cursor(u8 x,u8 y); void Writer_string(u8 x,u8 y,u8 *str); void Init_lcd12864(); #endif C代码 #include "config.h" #include "lcd12864.h" void Set_byte(u8 dat) { u8 i = 0; for(i = 0;i < 4;i++) { e = 1; if(dat & 0x80) rw = 1; else rw = 0; dat <<= 1; e = 0; } } void Busy() { u8 i = 0; u8 dat = 0; u8 dat1 = 0; rs = 0; rs = 1; Set_byte(0xfc); for(i = 0;i < 7;i++) { if(rw & 0x01) dat = 1; else dat = 0; dat |= dat; dat <<= 1; } while(dat1 & 0x80); } void Writer_com(u8 com) { Busy(); rs = 0; Set_byte(0xf8);//写指令 Set_byte(com & 0xf0); Set_byte(com << 4); rs = 1; } void Writer_dat(u8 dat) { Busy(); rs = 0; Set_byte(0xfa); Set_byte(dat & 0xf0); Set_byte(dat << 4); rs = 1; } void Writer_cursor(u8 x,u8 y) { u8 cursor = 0; switch(x) { case 1: cursor = 0x80;break; case 2: cursor = 0x90;break; case 3: cursor = 0x88;break; case 4: cursor = 0x98;break; } cursor = y + cursor; Writer_com(cursor); } void Writer_string(u8 x,u8 y,u8 *str) { Writer_cursor(x,y); while(*str != ' |