Go to Post People in FIRST ARE lucky, because they are living a very creative adventure which just doesn't let up, and that is okay. Who wants to sit there watching TV and being a spectator anyway. - DougHogg [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
  #5   Spotlight this post!  
Unread 24-03-2004, 05:57
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: digital input question...

Quote:
Originally Posted by KenWittlief
the digital inputs on the RC are already defined in the code for you - they can only have a value of 1 or 0

all you need to do is look at the right variable

rc_dig_in01 is digital input one on the RC

so you can do stuff like

if (rc_dig_in01 ==1) variableXYZ=123;

if (rc_dig_in14 ==0) variableQRS=127;

what else do you want to do with them?
Looking back at my old post, I meant that, but I see how you didn't get it. You can't access a certain bit in a variable in an actual function. The first syntax you stecified can be used in a struct like this:

Code:
stuct bitVariable
{
int bit0:1;
int bit1:1;
int bit2:1;
int bit3:1;
// ...
};
Basically, tht gives each of the variables inside it one bit of the int. (at least, I think I got that right... ) Like Ken said though, you can just read the variable directly.
__________________

 


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