i use ccs compiler , on the driver i saw LCD.c but i failed to use to display a float data or int data from my code .. anyone can help ?
what shud I do if I need to display a float or int ? please help
Rich (BB code):
#include <16F877.h>
#device ADC=12
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#include <LCD.c>
void main()
{
int chan ;
float analin[8], disvolts[8], current;
setup_adc(ADC_CLOCK_INTERNAL);
setup_adc_ports(ALL_ANALOG);
while(1)
{
for(chan=0;chan<8;chan++)
{ delay_ms(50);
set_adc_channel(chan);
analin[chan] = read_adc();
disvolts[chan] = (analin[chan])/204.6;
current = (disvolts[chan]*240);
lcd_init();
lcd_putc("\f hello");
lcd_putc(current);
}
}
}
what shud I do if I need to display a float or int ? please help
Last edited by a moderator: