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

If statements with longs

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



Joined: 27 Mar 2005
Posts: 30

View user's profile Send private message Visit poster's website

If statements with longs
PostPosted: Sat Apr 23, 2005 2:12 pm     Reply with quote

maybe it is just that I have to work on the weekend but I cannot seem to get this to work

I am creating a timer of sorts with four sensors on it and I want to keep the fastest time I have ever got.

If I dimension my varibles as longs (which they need to be ) it does not work if they are dimesioned and int it works fine although I cannot have any time past 2.55 seconds.

here is the code sippet
Code:

   if (besttime < oldtime) {
      oldtime = besttime;
      //store in eeprom
   }


can anybody help me??


I am using pcwh v 3.22 and an 18f452
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Sat Apr 23, 2005 4:45 pm     Reply with quote

Not with what you posted. The problem must be elsewhere. Look at the LST file. Do some debugging and find out what the problem is.
Douglas Richard



Joined: 08 Sep 2003
Posts: 49
Location: Concord NH

View user's profile Send private message Send e-mail Visit poster's website

eeprom?
PostPosted: Wed Apr 27, 2005 12:52 pm     Reply with quote

If you are using the same functions to store your ints as well as longs in the eeprom that could be your problem? You may need to break your long into two ints and then same individually.
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