Go to Post we were sick and tired of compromises: "speed or torque", "traction or maneuverability", etc.; bump that, we want it all. all we had to compromise was simplicity. - RogerR [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Spotlight this post!  
Unread 08-04-2004, 14:35
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,576
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: digital input question...

Quote:
Originally Posted by Astronouth7303
If you want the 2 least significant bits, wouldn't it make more sense to do:
Code:
if(someVar & 3) evenmorestufftodo;
?
That is what I would do, becasue the modulus operator is often slow (of course depending on the microprocessor). I haven't checked on the PIC, but if you ever want to move your code to a different platform, it's best to write for the lowest common denominator.

Sorry for bringing this thread up from the dead.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
counting digital input CharlieWilken Programming 9 22-03-2004 19:56
Digital In Question Tom Bottiglieri Control System 5 02-03-2004 17:09
Question about input pins. Tom Bottiglieri Programming 3 15-02-2004 15:12
How do u hook up the digital input to the sensor's wires Fares Technical Discussion 2 14-02-2003 16:41
Robot Digital Input Mike Norton Technical Discussion 5 16-01-2003 14:31


All times are GMT -5. The time now is 02:58.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi