matcobra
Joined: 14 Feb 2011 Posts: 8
|
|
Posted: Mon Mar 28, 2011 10:50 am |
|
|
thks, I have read your link but I just get blur. How I must supposed to combine the coding from the link with my original coding?
my original coding:
Code: |
#include <16F877A.h>
#device adc=10
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=10000000)
#include <lcd.c>
#define x input (pin_b0) // ph output
#define y input (pin_b1) // voltage output
//#define z input (pin_b2) // glucose output
void main()
{
int16 adc_value;
float value1;
float value2;
float volt;
lcd_init();
setup_adc_ports(AN0);
setup_adc(ADC_CLOCK_DIV_8);
set_adc_channel(0);
while(1)
{
value1=read_adc();
value2=(value1*5)/1023;
volt=value2*2 ;
lcd_putc("\f----:FRUITi:----\n");
delay_ms(3100);
if(x==1)
{
if((volt>5.00)&&(volt<=10.00))
{
printf(lcd_putc,"T:SWEET \n",);delay_ms(3200);
printf(lcd_putc,"G:MANY \n",);delay_ms(3200);}
else if((volt>3.00)&&(volt<=5.00))
{printf(lcd_putc,"T:SWEETSOUR \n",);delay_ms(3200);
printf(lcd_putc,"G:MEDIUM \n",);delay_ms(3200);}
else if((volt>0.00)&&(volt<=3.00))
{printf(lcd_putc,"T:SOUR \n",);delay_ms(3200);
printf(lcd_putc,"G:LITTLE \n",);delay_ms(3200);}
}
if(y==1)
{
{
printf(lcd_putc,"pH:%3.2f",volt);delay_ms(3200);}
}
}
}
|
ok, if I managed to do this, i want to ask, are the data will be save inside PIC?...or we need to used external memory card to save the data?... Can you explain my problems..I just get blur, do we need to used external memory card too if we can save data inside PIC... |
|