Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Electrical (http://www.chiefdelphi.com/forums/forumdisplay.php?f=53)
-   -   How to connect the touch sensor? (http://www.chiefdelphi.com/forums/showthread.php?t=43633)

DemonYawgmoth 09-02-2006 15:51

How to connect the touch sensor?
 
We want to use one of the touch sensors that came in the sensor bag this year, and we cant seem to find anything online as to how to connect the touch sensor to the robot controller and such. Where would the wires connect on the RC? Would it plug into a digital input or analog input. I'm guessing analog, but im not sure? Thanks in advance guys.

Alan Anderson 09-02-2006 16:07

Re: How to connect the touch sensor?
 
Do you mean microswitch?

The "common" connection goes to ground, and either the "normally open" or "normally closed" connection goes to a digital input on the RC. You'll read its value as 1 when the switch is open, and 0 when the switch is closed.

DemonYawgmoth 09-02-2006 16:34

Re: How to connect the touch sensor?
 
maybe im doing something incorrectly, but if i test it with if (rc_dig_in01 == 0) and then do some other stuff, would that work? also, how would we print stuff with printf()? we used it 2 years ago but i forgot how to get it to work. Also, i forgot the proper procedure for connecting the RC or OI to the computer to actually get these printf values. Thanks.

Chriszuma 13-02-2006 00:29

Re: How to connect the touch sensor?
 
Yes, that should work, as long as the stuff you want it to do is enclosed in {braces}. The printf command is very simple.

Code:

printf( "The digital in is reading %d", (int)rc_dig_in01 );
When you download the code with IFI Loader, it should automatically bring up a terminal window that dissplays the printf outputs. (you can also click 'terminal window' in the menu to bring it up).


All times are GMT -5. The time now is 10:12.

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