|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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.
|
|
#2
|
|||||
|
|||||
|
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. |
|
#3
|
||||
|
||||
|
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.
|
|
#4
|
||||
|
||||
|
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 ); |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Bannner IR sensor Measures Ball Exit Velocity | Dale(294engr] | Technical Discussion | 4 | 15-02-2006 23:57 |
| Making a Sensor Board | SpaceOsc | Technical Discussion | 11 | 15-05-2004 12:46 |
| heres the code. y this not working | omega | Programming | 16 | 31-03-2004 15:18 |
| Quick Optical Sensor Question | zorro | Technical Discussion | 10 | 21-01-2003 06:39 |
| How do you connect optical sensor? | archiver | 2001 | 1 | 23-06-2002 23:05 |