Using, PIC 18F2520, CCS C Compiler, 6.144 Mhz crystal,
unsigned char UNITS[7][16] = {"PRESSURE ", "TEMPERATURE ", "LEVEL ", "VOLUME ", "FLOW ", "FREQUENCY ", "PERCENTAGE "};
unsigned char PRESSURE[9][16] = { "BAR ", "mbar ", "psi ", "KSC ", "cmWC ", "mmWC ", "inWC ", "KPa ", "Mpa "};
like this i have declared many variables, for temperature, level, volume, flow, frequency, percentage....
void main()
{
while(1)
{
if(button_pressed)
{
i++;
printf(lcd_data,"%s",units
);// print the string on LCD
// conditional checking and printing the string.
}
}
}
Above shown is sample program. When i declared like this, my RAM memory gets 90%. Is there any other possible methods to print the string on LCD.
Tried using switch, but the program very large.
need help.
Thanks in advance