Go to Post Based on EXTENSIVE analysis of this image, I have concluded that we will have to use wires on our robots. I am certain of it. - theCADguy [more]
Home
Go Back   Chief Delphi > Technical > Programming
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:00
Joelster Joelster is offline
Registered User
#0758 (Roboticats)
 
Join Date: Feb 2002
Location: Blenheim
Posts: 11
Joelster is an unknown quantity at this point
Angry Controller Programming

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
C controller Rorschach Kit & Additional Hardware 1 29-10-2003 19:21
New Controller Specs Posted Jnadke Programming 58 05-10-2003 08:18
serious problem found - robot controller resets when jarred! KenWittlief Electrical 23 19-03-2003 13:30
Hooking up Controller to computer for programming. Dragon45 General Forum 3 30-01-2003 00:22
Error found in programming for the pump and pressure switch sjharobotics Programming 4 06-02-2002 17:46


All times are GMT -5. The time now is 09:55.

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