john120
Banned
- Joined
- Aug 13, 2011
- Messages
- 257
- Helped
- 11
- Reputation
- 22
- Reaction score
- 10
- Trophy points
- 1,298
- Activity points
- 0
Hello can u plz help me to display message and temperature and voltage using different functions,meanwhile not all those parameters defined in main function,I want to display on the lcd using ccs c compiler.I am using PIC 16F877A.
I did an example but the problem comes from calling the function which I called
float tempdisplay()
{
setup_adc_ports(AN0);
setup_adc(ADC_CLOCK_INTERNAL);
set_adc_channel(0);
adc_value = read_adc();
volts = ((float)(adc_value * 500)/1023.0);
delay_ms(10);
volts2 = ((float)(adc_value * 500)/1023.0);
delay_ms(10);
volts3 = ((float)(adc_value * 500)/1023.0);
delay_ms(10);
volts4 = ((float)(adc_value * 500)/1023.0);
delay_ms(10);
volts5 = ((float)(adc_value * 500)/1023.0);
delay_ms(10);
volts1=(volts+volts2+volts3+volts4+volts5)/5;
voltsf=(volts*1.8)+32;
}
this temperature is must be displayed when I push a button on RC4 and then the next function is to display :
void float messagedisplay()
{
delay_us(200);
printf(lcd_putc,"\fWELCOME");
delay_ms(500);
printf(lcd_putc,"\fTO");
delay_ms(500);
printf(lcd_putc, "\fPIC 16F877A", );
delay_ms(500);
printf(lcd_putc, "\fPROGRAMMING");
}
I am trying to call those functions in main function but the compiler gives me the error:
undefined identifier:tempdisplay.
Thanks.
I did an example but the problem comes from calling the function which I called
float tempdisplay()
{
setup_adc_ports(AN0);
setup_adc(ADC_CLOCK_INTERNAL);
set_adc_channel(0);
adc_value = read_adc();
volts = ((float)(adc_value * 500)/1023.0);
delay_ms(10);
volts2 = ((float)(adc_value * 500)/1023.0);
delay_ms(10);
volts3 = ((float)(adc_value * 500)/1023.0);
delay_ms(10);
volts4 = ((float)(adc_value * 500)/1023.0);
delay_ms(10);
volts5 = ((float)(adc_value * 500)/1023.0);
delay_ms(10);
volts1=(volts+volts2+volts3+volts4+volts5)/5;
voltsf=(volts*1.8)+32;
}
this temperature is must be displayed when I push a button on RC4 and then the next function is to display :
void float messagedisplay()
{
delay_us(200);
printf(lcd_putc,"\fWELCOME");
delay_ms(500);
printf(lcd_putc,"\fTO");
delay_ms(500);
printf(lcd_putc, "\fPIC 16F877A", );
delay_ms(500);
printf(lcd_putc, "\fPROGRAMMING");
}
I am trying to call those functions in main function but the compiler gives me the error:
undefined identifier:tempdisplay.
Thanks.