Go to Post If they want my business, then they should act accordingly. If they don't, I am quite happy to take my business (and that of my $16.5 billion organization) elsewhere. - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Pneumatics
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 11-02-2014, 15:55
magnets's Avatar
magnets magnets is offline
Registered User
no team
 
Join Date: Jun 2013
Rookie Year: 2012
Location: United States
Posts: 748
magnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond repute
Re: Still Having Pneumatics Problems

Quote:
Originally Posted by Oblarg View Post
Caveat: While I know java, I'm not a robot programmer so I might be completely wrong about this.

That said, it seems like a really bad idea to use while loops in that way, as it makes it impossible for any code to execute at the same time as your solenoid commands. Moreover, since there is always one of your conditions that is true, you will in general never be able to execute any code other than that specific set of solenoid commands. Using different buttons for forward and backward commands on a double solenoid seems bad practice, too, without some sort of way to handle the case where both buttons are pressed at once, though I do not know off the top of my head what the behavior would be in this situation without something explicitly handling it in code, but I could imagine it might be unfortunate (ironically, the fact that you're going to get caught in a loop with your given code handles this problem by itself as the forward and backward commands can't execute simultaneously, but upon revising it it'd rear its head).
You're right. The robot program is one big loop. To get it to work, you'll need to change those while loops to if/then/else.
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


All times are GMT -5. The time now is 17:18.

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