Go to Post The game is as much a competition of strategies as it is of robots. There is never any one "best strategy." If teams choose to use this as their strategy, find one that will beat them. - srjjs [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 14-01-2003, 16:54
Redmen Redmen is offline
Registered User
#0939
 
Join Date: Jan 2003
Location: South Dakota
Posts: 1
Redmen is an unknown quantity at this point
PBasic Help

Hey I need a little help. I’ve worked a little bit with PBasic but whenever I try and write a code for what I’m doing it doesn’t seem to work. I was just wondering if anyone could lend me his or her idea on how to generate the code. What I want to do is when you, for example, hit the trigger button on joystick 1 it performs an operation of opening and closing two different switches which would control a set of cylinders. I would like one button to cause a set of cylinders to close an arm and then cause a different set on relay 2 to push them up. In reality control two relays on one joystick button, which intern causes one to open and then the other to in a set of steps. If any one could please lend me some idea of an operation to do this it would be very much appreciated.

~Ferret
  #2   Spotlight this post!  
Unread 14-01-2003, 17:10
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Is this for something like the variable-extension cylinder somebody asked about in the pneumatics forum? Or is it something else?

Anyways, from what I can understand, you want to press a button and then have two events occur with some time between them, right? If so, take a look at CogCode2k2, available at my website, http://www.robbayer.com/software.html. Last year, we had a system where you pushed a button on the joystick, the robot stopped for a second, the gear shifted for a second, and then the robot started moving again. With some minor modifications you can probably make it work for your application as it is the same basic concept. If you need help with the mods, email/PM me.
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
  #3   Spotlight this post!  
Unread 14-01-2003, 17:15
n[ate]vw's Avatar
n[ate]vw n[ate]vw is offline
Registered User
#0933 (Adler Attack)
 
Join Date: Jan 2003
Location: Rockford, IL
Posts: 48
n[ate]vw is an unknown quantity at this point
Send a message via AIM to n[ate]vw
Because your program must loop repeatedly, you will have to store, in a variable or in the extra RAM, a number that will tell you what state your program should be in.
For example, the first time it detects the button, it would start moving the arm, and store a value so that the next time your program goes through the loop, it will do the next operation (or wait a few loops first). I think the RC is designed to loop about 25 times/sec. You can't pause during a loop to wait for your arm to close or something, or you will start dropping packets and wind up with an error, most likely.

Hope this helps.
__________________
Adler Attack #933 -- Trigos

Last edited by n[ate]vw : 14-01-2003 at 17:29.
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
PBASIC ARCTAN function Greg Ross Programming 14 11-05-2003 12:28
Obscure PBASIC for RoboEmu rbayer Programming 1 28-03-2003 23:57
PBasic 2.5 vs. 2.0 Anthony Kesich Programming 6 09-02-2003 22:06
RoboEmu 1.09 (supports PBASIC 2.5) rbayer Programming 22 21-01-2003 17:22
PBASIC Loop Speed? archiver 2001 3 23-06-2002 23:46


All times are GMT -5. The time now is 04:00.

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