Go to Post Well, air conditioners when pointed inside the house make it cooler. So I figure if EVERYONE turns their air conditioners on full blast and just point them out the window, we should more or less get rid of this "warming" nonsense. - Mike [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 08-02-2002, 20:15
Joelster Joelster is offline
Registered User
#0758 (Roboticats)
 
Join Date: Feb 2002
Location: Blenheim
Posts: 11
Joelster is an unknown quantity at this point
A quick question

I know i should post this in the techinical but i need an answer now. Here is my question

We are trying to extend and retract a cylinder with a button push. We've already made it work well with two different buttons, but now we're just trying to make the joystick more user-friendly. We have all programmed in C++ and Turing languages, and have tried to incorporate that type of logic in our programs, but have failed miserably. For example, logically one would think that "p1_sw_top = 1" means that the button is pressed, but we have found that it is actually "p1_sw_top = 0". Does Basic not allow If statements inside other If statements?

This is part of the program, and we want to know what part doesn't work. We have declared count1 and assigned a value of 1 to it at the beginning of the program, outside the main loop.

if p1_sw_top = 0 then turn:
if count1=1 then left:
relay1_fwd = 0
relay1_rev = 1
count1 = 2
left:
if count1=2 then right:
relay1_fwd = 1
relay1_rev = 0
count1 = 1
right:
turn:

Another example program that we have tried is :

'if ((p1_sw_top = 0) &~ (count1=2))then turn:
' relay1_fwd = 1
' relay1_rev = 0
' count1 = 2
'turn:

'if (p1_sw_top = 0) & (count1 = 2) then turn1:
' relay1_fwd = 1
' relay1_rev = 0
' count1 = 1
'turn1:

For some reason, the controller doesn't wait for a button to be pressed, it just sees "count1 = 1," and extends.


Any help and/or suggestions would be greatly appreciated.
 


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 08:16.

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