Go to Post You might want to read...the Manual very carefully. . - dlavery [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 10-02-2003, 19:51
Gusman1188 Gusman1188 is offline
Registered User
FRC #0870
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 1930
Location: S
Posts: 43
Gusman1188 will become famous soon enoughGusman1188 will become famous soon enough
Unhappy 26 variable limit

Perhaps I'm missing the obvious, but HOW do I write comands to motors, keep a count, etc. etc. all in 26 variables? I thought that byte vs nib might be the answer, but it isn't.

I'm trying to do the "outer" counting loop for the 15 seconds of autonomous mode. I have another counter for putting the robot through its paces.

Any help will be greatly appreciated.
__________________
Team R.I.C.E. 870

2006 SBPLI Regional Winner
2006 SBPLI Imagery Award
2005 SBPLI Regional Winner
2004 SBPLI Xerox Creativity
2003 SBPLI Regional Winner
2003 CT J&J Sportsmanship
2003 SBPLI KPC&B Entrepenuership
2002 SBPLI Rookie All-Star
  #2   Spotlight this post!  
Unread 10-02-2003, 20:05
Jnadke Jnadke is offline
Go Badgers!
#0093
Team Role: Alumni
 
Join Date: Jan 2002
Location: Appleton, WI
Posts: 775
Jnadke is on a distinguished road
Send a message via ICQ to Jnadke Send a message via AIM to Jnadke Send a message via Yahoo to Jnadke
http://www.chiefdelphi.com/forums/pa...er&paperid=165


One of the nice features of PBASIC 2.5 if you're using the new code is that they make it easier to use the scratchpad RAM. Scratchpad RAM is a place where you can store numbers and stuff, but you can't do operations to it.

Read [location], variablename
Write [location], variablename
[location] = 0-62 (bytes)
See page 7 of the above document for improvements, and read the Parallax Manual for further description.

Other than that, try to strip down your variable requirements to a bare minimum.


I hope that helps, I'm having trouble understanding what you mean... please try to explain again.
__________________
The best moments of our lives fall in two categories: those that did happen and those that did not.
  #3   Spotlight this post!  
Unread 10-02-2003, 20:26
Jeff_Rice's Avatar
Jeff_Rice Jeff_Rice is offline
ElementisRegamusProelium
#1359
Team Role: Programmer
 
Join Date: Dec 2002
Location: Linn County
Posts: 283
Jeff_Rice will become famous soon enoughJeff_Rice will become famous soon enough
goto www.first-codex.net

I love their site!
__________________
"He said my name is Private Andrew Malone
If you're reading this then I didn't make it home
But for every dream that's shattered another one comes true
This car was once a dream of mine now it belongs to you
And though you may take her and make her your own
You'll always be riding with Private Malone" David Ball, "Private Malone"
  #4   Spotlight this post!  
Unread 10-02-2003, 21:46
MsPB MsPB is offline
Team 870 Leader
#0870 (Team RICE)
Team Role: Teacher
 
Join Date: Feb 2003
Location: Southold (LI), NY
Posts: 1
MsPB is an unknown quantity at this point
Send a message via AIM to MsPB
I'm the real starter of this thread. I wasn't registered for the forums, so one of my students allowed me to use his login just to get started.

I've reluctantly taken on the role of programmer ... my experience has been in FORTRAN and I'm not used to being limited in the number of variables that can be declared.

I need at least 4 variables in order to control the robot in autonomous mode. That part is working fine. Now I want to add to the program in order to make the switch from autonomous mode to competition mode and I need to add more variables to the list.

so, my thoughts....please be patient, I didn't look seriously at PBasic until last Monday.

1) Are there any variables that are not used in autonomous mode that could be declared later when competition mode begins?
2) I need to use delta-t and the program doesn't recognize it unless I put it in the list, even though it is in the list of constants.
  #5   Spotlight this post!  
Unread 10-02-2003, 21:53
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,421
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
im not completely sure but i think that the memory is limited to 26 bytes not 26 variables. If possible i would try using smaller data types for your variables. Also look into the scratchpad ram.
__________________
1139 Alumni
  #6   Spotlight this post!  
Unread 10-02-2003, 22:19
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
There's a few little tricks to stay within 26-bytes. Here's a quick list:

1. Use the smallest size possible. Words give 0-65535, Bytes are 0-255, Nibs are 0-15, and bits are 0-1.
2. Reuse variables whenever possible. For example, you said you needed two counter loops--one during auto mode, the other regular. Is there any reason why you can't use the same variable for both?
3. Strip down your SERIN. Only import the stuff you actually use, making sure to update the constants accordingly. For example, the default code imports the X and Y axis for all the joysticks. If you don't use them, get rid of them. Also, just removing them from SERIN doesn't undeclare them. You need to find that section of the code.
4. As a last resort, use scratchpad. It can get to be very messy, very fast but it can also save you a lot of variable space if done correctly.


To answer a few of your specific questions:
Make sure delta_t is in the SERIN statement in the proper place
You cannot ever "undeclare" a variable. VAR, CON, and DATA are all compile-time directives that can be placed ANYWHERE in your source code and have the same effect.
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php

Last edited by rbayer : 10-02-2003 at 22:21.
  #7   Spotlight this post!  
Unread 10-02-2003, 22:58
Skabana159's Avatar
Skabana159 Skabana159 is offline
Robotics and Field Hockey
AKA: Jesse C. Owens
#0159 (Alpine Robotics)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2000
Location: Ft. Collins, CO
Posts: 92
Skabana159 is on a distinguished road
Send a message via AIM to Skabana159
[Adam Collet says:]

One thing to think about is putting the autonomous code in a seperate program, which has its own 26 bytes. To do this, split your programs up, then add ",[second program]" (or something like that) to the stamp directive of the first (autonomous) program. If you need to transfer some of the variables over, keep in mind that when you switch program, the data is not acutally destroyed, only the names are. As an extreme example, if you declared everything in the second program (perhaps using different names) in the same order as the first, you would have all of the same data in all of the same places. The scratch pad also transfers perfectly across programs.
__________________
"What most people do not understand is that the Buddha, the Godhead, resides just as comfortably in gears and circuits as in hills and trees. To believe otherwise is to dilute the Godhead."
-Robert Pirsig, Zen and the Art of Motorcycle Maintenance
  #8   Spotlight this post!  
Unread 12-02-2003, 20:35
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,421
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
could you please elabotate on this multi-program thing
__________________
1139 Alumni
  #9   Spotlight this post!  
Unread 12-02-2003, 22:27
Jferrante Jferrante is offline
Registered User
#0506
 
Join Date: Aug 2002
Location: New York
Posts: 67
Jferrante is an unknown quantity at this point
Send a message via AIM to Jferrante Send a message via Yahoo to Jferrante
you can find all the info for multibank codehere . Its the innovation First White Papers. It's really simple to do.
__________________
GodBless America
September 11, 2001... NEVER FORGET!
All Gave Some. Some Gave All. How much are you willing to give?
FDNYPD
  #10   Spotlight this post!  
Unread 12-02-2003, 22:38
Matt Reiland's Avatar
Matt Reiland Matt Reiland is offline
'The' drive behind the drive
None #0226 (TEC CReW Hammerheads)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1999
Location: Troy Michigan
Posts: 712
Matt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond reputeMatt Reiland has a reputation beyond repute
Here is our program from last year using multiple processor slots (Open Pegasus and the rest open automatically)

http://www.chiefdelphi.com/forums/at...=&postid=97164

However REMEMBER you don't get another 26 bytes for each slot, it is the same memory, if you call it something different in the next slot you are overriding something in the current slot and I am not sure there is an easy way to find out which variable will overwrite which variable.
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
variable? manodrum Programming 11 01-04-2003 17:20
$3500 limit - Who does not have questions Raul Rules/Strategy 5 12-01-2003 11:31
Pneumatic Actuator limit? Moshingkow Rules/Strategy 4 08-01-2003 02:16
$3500 spending limit Lisa General Forum 5 07-01-2003 10:06
what teams have a variable transmissions? Greg Perkins Technical Discussion 4 06-03-2002 06:10


All times are GMT -5. The time now is 15:13.

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