Hello Sergio, Thanks for your mail. Should the above read > Could this be a problem with my code? > I did the following steps in my code using MikroC complier: > adc_rd = adc_read(0); // read voltage from AN0 > t1 = 900-(float)(1.0625*adc_rd);//t1 is declared as float. I am doing this subtraction because my opamp gives an output of 0V for 900mV and 4.139V for 0mV. > t3long = (long)t1long; > //I am proceeding to LCD display section thereafter. Should the above read t1 = 900 - (float)(adc_rd) * 1.0625; t3long = (long)t1; The second line was a typo. Am I wrong in the first line? Sairam ________________________________ From: sergio masci To: Microcontroller discussion list - Public. Sent: Sun, March 21, 2010 5:35:22 PM Subject: Re: [PIC] ORP problem On Sat, 20 Mar 2010, yamanoor sairam wrote: > Could this be a problem with my code? > I did the following steps in my code using MikroC complier: > adc_rd = adc_read(0); // read voltage from AN0 > t1 = 900-(float)(1.0625*adc_rd);//t1 is declared as float. I am doing this subtraction because my opamp gives an output of 0V for 900mV and 4.139V for 0mV. > t3long = (long)t1long; > //I am proceeding to LCD display section thereafter. Should the above read t1 = 900 - (float)(adc_rd) * 1.0625; t3long = (long)t1; Regards Sergio Masci -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist