|
|
![]() |
![]() |
|
|||||||
|
![]() |
Thread Tools | Rate Thread | Display Modes |
#1
![]() |
|||
|
|||
Relay Assignments
I am trying to assign more than one joystick button to a single relay_rev. I have tried using an "=" sign, I have tried adding a new line but the program recognizes one but not the other. How can I do it? Thanks!
|
#2
![]() |
||||
|
||||
Re: Relay Assignments
The default code includes some code that controls some of the relays, make sure you check if that is overriding some of your stuff.
|
#3
![]() |
|||||
|
|||||
Re: Relay Assignments
Quote:
Code:
relay3_rev = p1_sw_trig | p2_sw_trig; |
#4
![]() |
|||
|
|||
Re: Relay Assignments
Here is the code I have:
relay5_rev = p3_sw_aux1; relay5_rev = p4_sw_aux1; There are no other references to the relay in the "Buttons to Relays" section. It seems to me that it should work??? |
#5
![]() |
||||
|
||||
Re: Relay Assignments
Ah, I misunderstood what you are trying to do (thought you meant multiple relays to one button, not vice versa). Alan Anderson has it right. Use the "or" operator just as he suggested.
|
#6
![]() |
|||||
|
|||||
Re: Relay Assignments
Code:
relay5_rev = p3_sw_aux1; relay5_rev = p4_sw_aux1; You need to set the value based on a combination of the two switches. The | "or" operator will return a value of zero if both its operands are zero, and a value of one if either or both are one. Code:
relay5_rev = p3_sw_aux1 | p4_sw_aux1; |
#7
![]() |
|||
|
|||
Re: Relay Assignments
Quote:
|
#8
![]() |
||||
|
||||
Re: Relay Assignments
Use some printf's or other diagnostic and determine if the trigger that isn't working is actually changing the variable.
|
#9
![]() |
|||||
|
|||||
Re: Relay Assignments
Quote:
Specifically, what do you have connected to the Spike, and what else is it connected to? |
#10
![]() |
|||
|
|||
Re: Relay Assignments
It works! You guys are awesome! Thanks so much!
|
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Spike (relay) module pin out | coreyjon | Electrical | 14 | 04-05-2004 06:05 AM |
Relay Aliases Backwards | Jeff Zampieron | Programming | 19 | 02-18-2004 03:27 PM |
Wiring the relay for the pnumatics | Placebo | OCCRA | 3 | 11-05-2002 10:04 PM |
Division assignments now available in Team 340 database | archiver | General Forum | 13 | 06-24-2002 02:05 AM |
Relay Outputs | OddOne | Technical Discussion | 3 | 02-01-2002 06:52 PM |