Go to Post There were no heroes on the team, just everyone doing their part. - nuggetsyl [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 06-01-2003, 00:20
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
The New PBASIC

OK, I've figured it out, and in case anyone wants to get started, here are the new commands and the ways you can use them. Use at your own risk as it is possible Parallax will never release the updated editor and your code will be worthless:

1. NEW IF SYNTAX! There's two, actually.
The first is:
Code:
if condition then
code to execute if condition is true
else
code to execute otherwise
endif
The second is:
Code:
if condition then statement
These should make people happy as if statements now work like you're used to from C/Java/etc.

2. SELECT. Almost exactly like C's switch:
Code:
SELECT variable/expression
CASE value1
commands
CASE value2
commands
ENDSELECT
3. DO...LOOP. Like do/while.
Either the DO or the LOOP can be followed by the keyword WHILE or UNTIL. Putting it on the DO will cause it to be checked before executing any of the body. Putting it on the LOOP will cause it to be checked only after the body has been executed at least once. Examples:
Code:
 
DO
commands to execute
LOOP

-or-

DO WHILE condition
commands to execute
LOOP

-or-

DO
commands to execute
LOOP WHILE condition
There's one other new one, but I can't remember what it is at this time. Something similar to BRANCH, if I remember correctly.

Hope that helps.

--Rob

P.S. RoboEmu 1.09 will support all these new commands and should be done tomorrow afternoon.
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php

Last edited by rbayer : 06-01-2003 at 00:27.
  #2   Spotlight this post!  
Unread 06-01-2003, 08:29
ttedrow's Avatar
ttedrow ttedrow is offline
Herding electrons
AKA: Tim Tedrow
FRC #0281 (EnTech)
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2000
Location: Greenville, SC
Posts: 165
ttedrow will become famous soon enoughttedrow will become famous soon enough
Thanks Rob

Now all we need is First/InnovationFirst/Parallax to get their "stuff" together and get us working editor/compiler software.
__________________
Sr. Design Engineer
Caterpillar Inc.
Greenville, SC

KD4EGM

FRC 281 Greenvillains
Infected with the FIRST virus in 2000

Yes, Chute Door!!!
  #3   Spotlight this post!  
Unread 06-01-2003, 09:27
Jeff Waegelin's Avatar
Jeff Waegelin Jeff Waegelin is offline
El Jefe de 148
AKA: Midwest Refugee
FRC #0148 (Robowranglers)
Team Role: Engineer
 
Join Date: Aug 2001
Rookie Year: 2001
Location: Greenville, TX
Posts: 3,132
Jeff Waegelin has a reputation beyond reputeJeff Waegelin has a reputation beyond reputeJeff Waegelin has a reputation beyond reputeJeff Waegelin has a reputation beyond reputeJeff Waegelin has a reputation beyond reputeJeff Waegelin has a reputation beyond reputeJeff Waegelin has a reputation beyond reputeJeff Waegelin has a reputation beyond reputeJeff Waegelin has a reputation beyond reputeJeff Waegelin has a reputation beyond reputeJeff Waegelin has a reputation beyond repute
So, in other words, PBASIC is becoming more like standard BASIC. I like it. Now, if we could just add a few more variables, floating point math, and negative numbers, we'd be all set...
__________________
Jeff Waegelin
Mechanical Engineer, Innovation First Labs
Lead Engineer, Team 148 - The Robowranglers
  #4   Spotlight this post!  
Unread 06-01-2003, 13:13
InnovationFirst's Avatar
InnovationFirst InnovationFirst is offline
Official FIRST Supplier
no team
 
Join Date: Nov 2002
Location: Greenville, Tx
Posts: 28
InnovationFirst has a reputation beyond reputeInnovationFirst has a reputation beyond reputeInnovationFirst has a reputation beyond reputeInnovationFirst has a reputation beyond reputeInnovationFirst has a reputation beyond reputeInnovationFirst has a reputation beyond reputeInnovationFirst has a reputation beyond reputeInnovationFirst has a reputation beyond reputeInnovationFirst has a reputation beyond reputeInnovationFirst has a reputation beyond reputeInnovationFirst has a reputation beyond repute
Exclamation Breaking News from Parallax

We just received news from Parallax that the release of PBASIC 2.5beta will be Friday, January 10th. The files will be available on www.innovationfirst.com (not Parallax). We apologize for the delay. Please do NOT contact Parallax, as this will just delay the release.

Last edited by InnovationFirst : 06-01-2003 at 19:07.
  #5   Spotlight this post!  
Unread 06-01-2003, 15:01
Raven_Writer's Avatar
Raven_Writer Raven_Writer is offline
2004 Detroit & Pittsburgh Winners
AKA: Eric Hansen
FRC #0005 (RoboCards)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Melvindale
Posts: 1,549
Raven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really nice
Send a message via ICQ to Raven_Writer Send a message via AIM to Raven_Writer Send a message via MSN to Raven_Writer Send a message via Yahoo to Raven_Writer
Quote:
Originally posted by Jeff Waegelin
So, in other words, PBASIC is becoming more like standard BASIC. I like it. Now, if we could just add a few more variables, floating point math, and negative numbers, we'd be all set...
The problem with negitive numbers is that unless they make it so that -127 is the new full-reverse number, then it will totally screw up your robot. Think of it this way:

127 = Full Forward

0 = Nothing (stopped)

-127 = Full Reverse

This above would have to be the new way to control the speed of your robot.

Note: This is how our controls specialist (I think you can call him) told me about the speed.
__________________
AIM: wisprmylastbreth
EMail: nightskywriter@gmail.com
Y!: synsoflife

"ai yoru ga" -- "Love the nights"
  #6   Spotlight this post!  
Unread 06-01-2003, 16:06
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
So, in other words, PBASIC is becoming more like standard BASIC. I like it. Now, if we could just add a few more variables, floating point math, and negative numbers, we'd be all set...

Floating point math is not a problem with the pbasic language, but rather with the BASIC stamp itself. We would require a much more expensive microprocessor if we wanted to do floats. This is also the reason we can't have more variables, there is only so much RAM space.
__________________
"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
  #7   Spotlight this post!  
Unread 07-01-2003, 16:33
AJ Quick's Avatar
AJ Quick AJ Quick is offline
Your Attention Please
FRC #0006 (CogSquad)
Team Role: Alumni
 
Join Date: Oct 2002
Rookie Year: 2001
Location: Minnesota
Posts: 464
AJ Quick has a spectacular aura aboutAJ Quick has a spectacular aura about
The changes seem better, it looks like the newer versions are starting to have a more uniform programming style. Most languages that I have worked with have used that kind of syntax.
__________________
-AJ Quick (Alum on Team 6)
http://www.HHSRobotics.com/

Place your attention entirely on my voice and try to ignore all the others. It is important to be able to focus on a single source of information while blocking out all the other things competing for your attention.
  #8   Spotlight this post!  
Unread 07-01-2003, 20:17
Morgan Jones Morgan Jones is offline
Registered User
no team
 
Join Date: Jan 2002
Location: Fairport, NY
Posts: 29
Morgan Jones is an unknown quantity at this point
Something rbayer didn't mention is the TCASE (Through CASE) command under SELECT. A TCASE is evaluated even if the previous CASE (or TCASE) evaluated as true. This would be like leaving out a break command in C/C++. Although no examples comes to mind at the moment, this feature may prove useful.

http://groups.yahoo.com/group/basicstamps/message/27596
__________________
Morgan Jones
Team 578: Fairport High School/Gleason Works
  #9   Spotlight this post!  
Unread 07-01-2003, 20:44
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
I knew I was forgetting something! Anyway, the other new one is ON. It's almost identical to BRANCH, except you can use it to do gosubs instead of just gotos.
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
  #10   Spotlight this post!  
Unread 07-01-2003, 20:57
Raven_Writer's Avatar
Raven_Writer Raven_Writer is offline
2004 Detroit & Pittsburgh Winners
AKA: Eric Hansen
FRC #0005 (RoboCards)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Melvindale
Posts: 1,549
Raven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really nice
Send a message via ICQ to Raven_Writer Send a message via AIM to Raven_Writer Send a message via MSN to Raven_Writer Send a message via Yahoo to Raven_Writer
Quote:
Originally posted by rbayer
I knew I was forgetting something! Anyway, the other new one is ON. It's almost identical to BRANCH, except you can use it to do gosubs instead of just gotos.
I'm just trying to see if I understand you right, you mean something like "if p2_y > 30 on 40 then gosub Exit"?
__________________
AIM: wisprmylastbreth
EMail: nightskywriter@gmail.com
Y!: synsoflife

"ai yoru ga" -- "Love the nights"
  #11   Spotlight this post!  
Unread 07-01-2003, 21:02
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
No. It's like

ON counterVar GOSUB label0, label1, label2, label3, label4, label5

There may be brackets in there, but I don't remember.

Anyway, if counter counterVar has the value 0, it will GOSUB to label0. If it's 1, GOSUB label1, etc. It's identical to BRANCH, except you can do a GOSUB instead of just the equivalent of GOTO. Note that you can similuate a BRANCH exactly by doing

ON counterVar GOTO label0, etc.


As for the code you posted, PBASIC now supports what I like to call one-line-ifs, meaning you can do
if p2_y>30 then gosub exit

Similarly, you can do stuff like:
if (p1_y < 140 AND p1_y > 117) then p1_y=127
Mmmm... tasty.
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
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 17:14.

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