Thread: c debugger
View Single Post
  #13   Spotlight this post!  
Unread 09-12-2004, 09:54
stephenthe1 stephenthe1 is offline
Registered User
#1008
 
Join Date: Dec 2004
Location: Ohio
Posts: 113
stephenthe1 is on a distinguished road
Re: c debugger

um, would this code cause two pistons to fire assuming they are hooked up to relay 1 and relay2. also, you'll notice in my if statements that I used if its 1, then to execute the stuff, is that the right way of asking if the switch is one, or should I do (p2_sw_trig01), I've seen that but didn't know what it meant. what's the correct way? thanks.

Code:
 if (p1_sw_trig = 1) {
  relay1_fwd = 1;
  relay1_rev = 0;
  relay2_fwd = 1;
  relay2_rev = 0;
}
  if (p1_sw_trig = 0) {
 relay1_fwd = 0;
 relay1_rev = 0;
 relay2_fwd = 0;
 relay2_rev = 0;
}
  if (p2_sw_trig = 1) {
  relay1_fwd = 0;
  relay1_rev = 1;
  relay2_fwd = 0;
  relay2_rev = 1;
}
  if (p2_sw_trig = 0) {
 relay1_fwd = 0;
 relay1_rev = 0;
 relay2_fwd = 0;
 relay2_rev = 0;
}