Go to Post Physics is not a religion. - Jack Jones [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 09-02-2002, 00:13
s_alaniz s_alaniz is offline
Registered User
#0057 (Leopards)
 
Join Date: Jun 2001
Location: Houston, Tx
Posts: 73
s_alaniz is an unknown quantity at this point
OK you said that "p1_sw_top=0" occurs when the switch is pressed
If that is the case then the first program skips to "turn:" when the button is drepressed and doesn't execute the commands.
(Did you intend "p1_sw_top=1" as in the switch is NOT being pressed?) You said it executes the following commands without a button being pressed.... well that's what's you've got it programmed to do.



SO if you're NOT pressing the top button, and count1 =1 then the program skips to "left:" , fails the "count1=2" test and executes the "relay1_fwd = 1" and " relay1_rev = 0 " commands...reaffirms "count1 = 1 " (which it already is) and falls through the "right:" and "turn:" labels and continues to the rest of the program.
if no button is pushed and count1 is not changed externally, it repeats the sbove sequence.
If you're NOT pressing the top button, and count1=2 then the program fails the "count1=1" test and continues and sets "relay1_fwd = 0" and relay1_rev = 1" reaffirms count1=2 (which it already does) drops through "left:" taed the branch from "if count1 = 2 then right:" goes to "right:" drops through "turn:" and continues on throught the rest of the program.


In the second program... if you're NOT pressing a button, both conditional statements "'if ((p1_sw_top = 0) &~ (count1=2))then turn: " and "if (p1_sw_top = 0) & (count1 = 2) then turn1: " FAIL to branch (because p1_sw_top = 0 is false or "0" unless you push the button) and the program executes all the statements ... well you get the idea.

Anyone read this differently? I get confused easily.

Best wishes


Steve Alaniz


"What good is technology if you can't abuse it?" - Ted Forth
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Quick <hr> question Jack Website Design/Showcase 1 31-01-2003 22:19
Quick Optical Sensor Question zorro Technical Discussion 10 21-01-2003 06:39
To all the ladies in the hiz-ous!! lol a quick question archiver 2001 1 24-06-2002 02:12
Quick Question archiver 2001 5 24-06-2002 00:08
Quick Question, i guess Andrew Rudolph Motors 1 12-08-2001 14:39


All times are GMT -5. The time now is 16:06.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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