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

PIC18F452 C program

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







PIC18F452 C program
PostPosted: Thu Apr 03, 2008 1:45 pm     Reply with quote

Hello,
I have not used C programming in about 2 years, but need to switch over to it because some of the problems I'm encountering in assembly are beyond my knowledge. I cannot figure out how to program this formula in C and was wondering if anyone could help. Here it is

500(Vout-.25)/3.75

where Vout is a variable that is determined by the A to D in the PIC mentioned in the subject. I am using the Fosc/8 conversion mode.

Thanks!
Ken Johnson



Joined: 23 Mar 2006
Posts: 197
Location: Lewisburg, WV

View user's profile Send private message

PostPosted: Thu Apr 03, 2008 2:06 pm     Reply with quote

All you need is:

x = 500 * (Vout-0.25)/3.75;

Ken
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