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

ADC Voltage <> integer values(compiler)
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
FJMSoft



Joined: 20 Oct 2013
Posts: 36

View user's profile Send private message

PostPosted: Mon Nov 24, 2014 12:27 pm     Reply with quote

I am excited with all this, I am learning a lot!

Thank you PCM!
I was exactly thinking about something like that but didnt know how to do.
In Delphi I was using Trunc(float) and Round(float) functions, which converts float to integer.
I have searched CCS help but didnt found.
PCM, I have not understood why the "+ 0.5".

The second question was about something Ttelmah said to me about the ADC readings (Sat Nov 15, 2014 2:23 pm), that the maximum value ADC can read, I dont know if I understood well, I'm new to C, to CCS and to PIC, also my english is a little poor.

Thank you again.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Nov 24, 2014 12:40 pm     Reply with quote

Quote:
I have not understood why the "+ 0.5".

I gave you the quick way that works for your program.
This FAQ explains it:
http://c-faq.com/fp/round.html
FJMSoft



Joined: 20 Oct 2013
Posts: 36

View user's profile Send private message

PostPosted: Tue Nov 25, 2014 1:11 am     Reply with quote

Got it PCM!
Thank you!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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