CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Can't get value from ch1 ,Please help?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
kuosda
Guest







Can't get value from ch1 ,Please help?
PostPosted: Wed Feb 12, 2003 8:33 pm     Reply with quote

//pch V3.142
#include <18F452.h>
#USE DELAY(CLOCK=4000000)
#USE RS232(BAUD=9600, XMIT=PIN_C6, RCV=PIN_C7)
#include <Ad7705.c>
main()
{
long AD_CH0,AD_CH1;
adc_init();
AD_CH0 = read_adc_value(0);
AD_CH1 = read_adc_value(1);
adc_disable();
printf("CH0:\%6.4f CH1:\%6.4f\r\n",
convert_to_volts(AD_CH0),convert_to_volts(AD_CH1));
}
___________________________
This message was ported from CCS's old forum
Original Post ID: 11623
Tomi
Guest







Re: Can't get value from ch1 ,Please help?
PostPosted: Thu Feb 13, 2003 1:35 am     Reply with quote

Your "read_adc_value()" function doesn't work properly Smile
The problem is the same as in my "Count_butterflies()" function :)

:=//pch V3.142
:=#include <18F452.h>
:=#USE DELAY(CLOCK=4000000)
:=#USE RS232(BAUD=9600, XMIT=PIN_C6, RCV=PIN_C7)
:=#include <Ad7705.c>
:=main()
:={
:= long AD_CH0,AD_CH1;
:= adc_init();
:= AD_CH0 = read_adc_value(0);
:= AD_CH1 = read_adc_value(1);
:= adc_disable();
:= printf("CH0:\%6.4f CH1:\%6.4f\r\n",
:= convert_to_volts(AD_CH0),convert_to_volts(AD_CH1));
:=}
___________________________
This message was ported from CCS's old forum
Original Post ID: 11627
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group