Here is a new 'init' routine. Note that I do not have your hardware so this is untested code.
C:void lcd_init(void) { TRISD = 0x00; LATD = 0x00; LCD_RS = 0; // write control bytes __delay_ms(15); // power on delay lcd_write_cmd(0x30); __delay_ms(5); lcd_write_cmd(0x30); __delay_us(100); lcd_write_cmd(0x30); __delay_ms(5); lcd_write_cmd(0x20);// set 4 bit mode __delay_us(40); lcd_write_cmd(0x28); // 4 bit mode, 1/16 duty, 5x8 font lcd_write_cmd(0x08); // display off lcd_write_cmd(0x0F); // display on, blink curson on lcd_write_cmd(0x06); // entry mode }
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'C:/Users/Angus/Desktop/draft2.X'
make -f nbproject/Makefile-default.mk dist/default/production/draft2.X.production.hex
make[2]: Entering directory 'C:/Users/Angus/Desktop/draft2.X'
"C:\Program Files (x86)\Microchip\xc8\v1.35\bin\xc8.exe" --pass1 --chip=18F4550 -Q -G --double=24 --float=24 --emi=wordwrite --opt=default,+asm,+asmfile,-speed,+space,-debug --addrqual=ignore --mode=free -P -N255 --warn=-3 --asmlist --summary=default,-psect,-class,+mem,-hex,-file --codeoffset=100 --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-download,+config,+clib,-plib --output=-mcof,+elf:multilocs --stack=compiled:auto:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s" -obuild/default/production/lcd_utilities.p1 lcd_utilities.c
lcd_utilities.c:21: error: (255) not a member of the struct/union ""
lcd_utilities.c:21: error: (182) illegal conversion between types
int -> volatile union S271
lcd_utilities.c:51: error: (255) not a member of the struct/union ""
lcd_utilities.c:51: error: (182) illegal conversion between types
make[2]: *** [build/default/production/lcd_utilities.p1] Error 1
make[1]: *** [.build-conf] Error 2
int -> volatile union S271
(908) exit status = 1
nbproject/Makefile-default.mk:126: recipe for target 'build/default/production/lcd_utilities.p1' failed
make[2]: Leaving directory 'C:/Users/Angus/Desktop/draft2.X'
nbproject/Makefile-default.mk:78: recipe for target '.build-conf' failed
make[1]: Leaving directory 'C:/Users/Angus/Desktop/draft2.X'
make: *** [.build-impl] Error 2
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
BUILD FAILED (exit value 2, total time: 613ms)
I tried and I got this error code, Im also currently testing the lcd_write_string