View Single Post
  #2   Spotlight this post!  
Unread 18-02-2003, 00:13
Lloyd Burns Lloyd Burns is offline
Registered User
FRC #1246 (Agincourt Robotics)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Toronto
Posts: 292
Lloyd Burns is an unknown quantity at this point
Like the riddle about how to get down from a camel.... you don't, you get it from a duck!

In this case, you wire both terminals of the switch to the RC, on the digital input connector, and have the RC turn on a relay when the (NC) thing is open:

relay2_fwd = 1-pswitch

you may use higher level constructs like NOT or ~, but this gets the job done without worry.

For the above example, pswitch is an alias you would make in your programming for the input; say you use sw3 - you'd say "pswitch VAR rc_sw3". Let's also say you have your compressor connected to the M- (Black wire) and M+ (Red wire) terminals of a Spike, and you plug that Spike's "PWM" cable into the relay connector two.

Last edited by Lloyd Burns : 18-02-2003 at 00:23.