Go to Post Practice bots are not regulated by FIRST. Your practice bot could have a flamethrower and a jamming device on it, and they wouldn't care in the slightest. You just can't compete at a competition with it. :) - AlecMataloni [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 29-10-2002, 16:37
Keys Keys is offline
Registered User
AKA: Tony
#0134 (Team Discovery)
Team Role: Programmer
 
Join Date: Oct 2002
Location: Pembroke, NH
Posts: 19
Keys is an unknown quantity at this point
Send a message via ICQ to Keys Send a message via AIM to Keys Send a message via Yahoo to Keys
Talking Just a little question...

Hey everyone. I'm learning how to program right now, being taught by my team's lead programmer. I was wondering if any of you might know a good online tutorial, or maybe even a good book that teaches programming? Tutorials in both C++ and PBASIC would be cool...so if you guys know anything, let me know? Thanks.
  #2   Spotlight this post!  
Unread 29-10-2002, 17:34
Katie Reynolds Katie Reynolds is offline
Registered User
no team (NEW Apple Corps)
Team Role: Alumni
 
Join Date: Nov 2001
Rookie Year: 2001
Location: Appleton, WI, USA
Posts: 2,598
Katie Reynolds has a reputation beyond reputeKatie Reynolds has a reputation beyond reputeKatie Reynolds has a reputation beyond reputeKatie Reynolds has a reputation beyond reputeKatie Reynolds has a reputation beyond reputeKatie Reynolds has a reputation beyond reputeKatie Reynolds has a reputation beyond reputeKatie Reynolds has a reputation beyond reputeKatie Reynolds has a reputation beyond reputeKatie Reynolds has a reputation beyond reputeKatie Reynolds has a reputation beyond repute
Send a message via AIM to Katie Reynolds Send a message via Yahoo to Katie Reynolds
Check online at Parallax - I'm sure they have something for PBasic!

- Katie
__________________
Team #93 - NEW Apple Corps
Student - 2001-2004
Team #857 - Superior Roboworks
Mentor - 2006-2009
  #3   Spotlight this post!  
Unread 29-10-2002, 19:28
SlamminSammy's Avatar
SlamminSammy SlamminSammy is offline
Registered User
no team
Team Role: College Student
 
Join Date: Jun 2002
Location: Glasgow, Scoland
Posts: 140
SlamminSammy is on a distinguished road
Send a message via AIM to SlamminSammy
This is definately Rob's (rbayer) area, but he is ironically at his CompSci class at the U of MN right now. Try looking at HowStuffWorks "Software and Programming" located at http://www.howstuffworks.com/category.htm?cat=Program . They have tutorials on C, Java, PERL, etc. In addition, http://www.techtutorials.com may also be helpful.
__________________
The opinions stated above are not necessarily those expressed by the FIRST Robotics Program, its participating teams, or any other individual or organization.
  #4   Spotlight this post!  
Unread 29-10-2002, 20:01
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
I attached a zip file with my code from our last year's robot. Included is some programming guidelines you should follow when programming your robot (put together by one of our EEs). They are good programming ethics, your time will be much easier in the long run if you study them and follow them. Take a look at the program and you'll see what I mean.

You'll need the PBASIC documentation from Parallax: http://www.parallaxinc.com/downloads...ual%20v2.0.pdf
It contains everything you'll need for understanding the code.

You'll also need the PBASIC editor from Parallax: http://www.parallaxinc.com/downloads...p%20Editor.exe
Attached Files
File Type: zip nac.zip (35.5 KB, 47 views)
__________________
The best moments of our lives fall in two categories: those that did happen and those that did not.

Last edited by Jnadke : 29-10-2002 at 20:04.
  #5   Spotlight this post!  
Unread 29-10-2002, 21:00
Keys Keys is offline
Registered User
AKA: Tony
#0134 (Team Discovery)
Team Role: Programmer
 
Join Date: Oct 2002
Location: Pembroke, NH
Posts: 19
Keys is an unknown quantity at this point
Send a message via ICQ to Keys Send a message via AIM to Keys Send a message via Yahoo to Keys
Aw, thanks everyone, this is going to help me a lot! You all rule!
  #6   Spotlight this post!  
Unread 29-10-2002, 22:28
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'm back now. Anyway, for learning PBASIC, follow the suggestions given in this thread.

As for learning C/C++, you're probably best off buying a book. I have C++: How To Program by Deitel and Deitel. It literally taught me everything I know about C++, and that was just the second edition. They're up to a fourth now.

As soon as I finish some of my current projects, I may go ahead and write a PBASIC/FIRST primer, covering all the basics as well as some example code, etc.

In any event, if you run into trouble with either PBASIC or C++, just ask in this forum and I (or someone else) will probably get back to you within a few hours.

--Rob
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
  #7   Spotlight this post!  
Unread 29-10-2002, 23:37
Unsung FIRST Hero
Nate Smith Nate Smith is offline
FRC Key Volunteer Trainer
AKA: CrazyNate
no team
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Old Town, Maine
Posts: 1,029
Nate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to beholdNate Smith is a splendid one to behold
Send a message via AIM to Nate Smith Send a message via Yahoo to Nate Smith
The CODEX

Check out the articles section here:
http://www.first-codex.net
__________________
Nate Smith
nsmith@smythsoft.com
12 seasons, 4 teams, and more time logged behind the scorekeeper's table than I care to remember...
returning for 2011? only time will tell...
  #8   Spotlight this post!  
Unread 30-10-2002, 12:52
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
Re: The CODEX

Quote:
Originally posted by Nate Smith
Check out the articles section here:
http://www.first-codex.net

Ahh... I was wondering where that went... All the old links I had were inoperative. But, yeah, the codex is the best place.


As for those Design and Code Review guidelines, you're supposed to use them in the coding process. Here's the general process.

1. Figure out what your robot is going to do.

2. List all things that are going in our out of the robot controller. They need coding. List what they hook up to (That's what the documentation is in the zip file).

3. Divide the parts of the robot into clearly defined areas (subroutines) (look at my sample program, there's a drive area, a controls area, compressor area, grabber area, a window motor area, a pneumatic cylinder area, etc.). It's up to you how far you want to divide it. The more you divide it, the less the code is inter-dependent (one thing wrong messes up the entire robot = no no). However, the more you divide it, the more complex it becomes. There's a certain point where this is balanced. I won't say that my way is best. It all depends on the programmer's preference. Use the Design Review guidlines while you are writing this up. After it is completed, gather peers together and go through it.

4. Write in paragraphs (english) what each section of the robot should do.

5. Now, translate these paragraphs into PBASIC code, or into pseudocode (a hybrid form of english and the desired coding language... no specific code is formed, but an outline is formed. if statements and such should be included to illustrate structure). For example:
Code:
drive area:
if driver doesn't want to reverse controls then go do drive stuff
<switch joystick controls, so front of robot becomes back>
drive stuff:
if deadzone present then go do other side
<calculate the motor speed with the desired algorithm>
other side:
if deadzone present then go back
<calculate the motor speed with the desired algorithm>
back:
return
6. Debug the robot code. Upload it and go through all the purpose of the subroutines and make sure they do what they were intended to. This should be the longest process of coding the robot. No matter how good of a coding job you think you did, it's better to find out something doesn't work now than on the playing field.



Of course, all these recommendations depend on if you like object-oriented code. My attempt at coding was to make PBASIC object-oriented. It succeeded, but object-oriented isn't what PBASIC is intended to be. Object-oriented means that there are certain areas of the code (functions, subroutines, etc) that are designed to accomplish a specific task. These functions/subroutines are then called by the main code to accomplish these tasks.

C++ and JAVA are object-oriented programming languages. BASIC is not, however (along with many others).
__________________
The best moments of our lives fall in two categories: those that did happen and those that did not.

Last edited by Jnadke : 30-10-2002 at 13:36.
  #9   Spotlight this post!  
Unread 30-10-2002, 14:50
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
Re: Re: The CODEX

Quote:
Originally posted by Jnadke


6. Debug the robot code. Upload it and go through all the purpose of the subroutines and make sure they do what they were intended to. This should be the longest process of coding the robot. No matter how good of a coding job you think you did, it's better to find out something doesn't work now than on the playing field.


Of course, all these recommendations depend on if you like object-oriented code. My attempt at coding was to make PBASIC object-oriented. It succeeded, but object-oriented isn't what PBASIC is intended to be. Object-oriented means that there are certain areas of the code (functions, subroutines, etc) that are designed to accomplish a specific task. These functions/subroutines are then called by the main code to accomplish these tasks.

C++ and JAVA are object-oriented programming languages. BASIC is not, however (along with many others).
If you do steps 1-5 correctly, and use pseudo-code in step 5, step six should actually be one of the shortest steps in the whole process.

As for object-oriented, what you are actually talking about is "modular" or "procedural" programming (it's NOT "functional", despite what many people/books say). Object-oriented would imply that you somehow encapsulated the data and functions into one big "object." The only real way to semi-sorta-kinda-maybe do object-oriented stuff in PBASIC is to use multiple program slots. That way, all the variables are stored in the same place as the functions that manipulate them. Even then, the data can manipulated by any object at will since everything uses one shared block of memory.

In either event, breaking your code into small pieces is a VERY good idea. It will make debugging much easier and will make it far simpler to make changes some time in the future.
__________________
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
my idea of a question forum... Ken Leung General Forum 12 30-11-2002 12:17
Joe - Please answer my question archiver 2000 2 24-06-2002 00:14
MnM EASY Question of the Day Winners! Mike Bonham General Forum 22 03-05-2002 21:21
Chief Delphi Site Question Mike Bonham General Forum 1 16-02-2002 22:18
Rookie Programmer has question about the default code DanL Programming 3 26-01-2002 19:59


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

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