Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Teach me? (http://www.chiefdelphi.com/forums/showthread.php?t=58442)

andyhoyt911 16-08-2007 00:07

Teach me?
 
Hey everyone!
I was wondering if someone could help me with programming. We use MPLAB(not even sure if thats what everyone uses, or just us) and I have no idea how to program. I need to learn, because nobody else on our team knows either. So can someone either point me to a good tutorial, or possibly teach me how?

Thanks.

-Adrianna

Deacon Blues 16-08-2007 00:36

Re: Teach me?
 
You may have already seen this, but http://www.chiefdelphi.com/forums/sh...ad.php?t=30976 is infinitely helpful in getting started. Plus read through all the documentation and whatnot pertaining to what you want to do, along with checking out the internal comments within each of the sections of code. At least, our default code came with comments when I was looking through it.

Anyway, not too helpful, but it could get you started.


Also, Demonoid? Needs more OiNK, #it, or x264.

Doug G 16-08-2007 00:42

Re: Teach me?
 
Have you searched the papers in CD-Media? There are some good resources there!! Do you have a copy of MPLAB? My next suggestion is start with the basic user code and read its comments. It is very well commented (although I feel maybe too much is there for starting out) and learn how to modify some of the variables within it. Better yet, have the robot there with you. Tweak the basic code so it does something different like have it drive forward when you move the joystick to the left or have it spin around when you press a joystick button. Dedicate some time to experiment with the code and get used to syntax, declarations, and write a function or two!

6600gt 16-08-2007 02:29

Re: Teach me?
 
Remember you also need C18, which is in fact the compiler. MPLAB is just the IDE(Integrated Development Environment). NOTE: you can only use the V2.4 of C18. The new ones don't work. You should have gotten this in your kit Microchip CD. If you don't have it or can't find it pm me with your email.

Good Luck...you have a long road ahead of you...but the EFFORT is well worth it.

Akash Rastogi 16-08-2007 03:06

Re: Teach me?
 
Hello again =),

I used simple programming tutorials and books when learning C. Check out www.programmingtutorials.com
Its free and surprisingly very fast to learn C or any other language.

andyhoyt911 16-08-2007 03:46

Re: Teach me?
 
thanks everyone :)

SamC 16-08-2007 13:08

Re: Teach me?
 
I know you already stated that you are using MPLab, but is there any reason that for your first year you can't use EasyC? As much as people say it limits you and whatever else, I think it would be very useful to at least play with it during the off-season... Just another idea

AdamHeard 16-08-2007 13:15

Re: Teach me?
 
Quote:

Originally Posted by SamSofa330 (Post 638993)
I know you already stated that you are using MPLab, but is there any reason that for your first year you can't use EasyC? As much as people say it limits you and whatever else, I think it would be very useful to at least play with it during the off-season... Just another idea

Sam is right.

For FIRST, easyC doesn't limit at all. It makes the simple, mundane code much easier and quicker to do; but it still allows custom code to be written in plain C. It's really a huge time saver.

I know a lot of programmers avoid EasyC because it's easier and they don't want their ego's hurt, but c'mon, it's a win/win situation. The code is done quicker, with less chance of syntax errors. And if you don't believe complex things can be done with it, look at team 40; they program entirely in easyC.

Also, for the programmers that defiantly stick to MPlab or other IDEs; I work at Northrop Grumman in the satelite area. Most of the programming is done in a program similar to EasyC, not an IDE like Mplab.

dtengineering 16-08-2007 13:16

Re: Teach me?
 
Do you have access to a VEX system? The VEX robots can be programmed using "C" and MPLAB and are much easier to take home to work on (and pick up when they decide to start smashing into everything because of a bug in the code.)

I have found that my students have had good success teaching themselves to program VEX and FRC machines using the tutorials and assistance available on CD and by... gasp... reading the manuals.

It is kind of dry, but if you stick with it, you should have some killer auto modes by March. Best of all, perhaps, with your experience as a driver you should be able to develop drive control code that makes your robot respond really well in telop mode as well.

Jason

AdamHeard 16-08-2007 13:27

Re: Teach me?
 
Quote:

Originally Posted by dtengineering (Post 638996)
Do you have access to a VEX system? The VEX robots can be programmed using "C" and MPLAB and are much easier to take home to work on (and pick up when they decide to start smashing into everything because of a bug in the code.)

I have found that my students have had good success teaching themselves to program VEX and FRC machines using the tutorials and assistance available on CD and by... gasp... reading the manuals.

It is kind of dry, but if you stick with it, you should have some killer auto modes by March. Best of all, perhaps, with your experience as a driver you should be able to develop drive control code that makes your robot respond really well in telop mode as well.

Jason

Yeah, building a sqaurebot with encoders on the drive, an ultrasonic sensor, Ir sensors, line followers, and maybe even touch sensors would keep you happy for a long time.

I personally would wire up teh KOP gyro to a squarebot and put encoders on the drive to try to make some decent autonomous drive functions.

I've found if you give yourself a project you want to do, you'll learn better than if you're just trying to learn.

Roger 18-08-2007 02:28

Re: Teach me?
 
Can you guys point me in the right direction to do VEX with MPLAB? Is it the same MPLAB as the FRC robots but with VEX-specific code? I actually had some project ideas for the VEX and, yes, I could be using EasyC but... Well, we'll leave that debate alone.

AdamHeard 18-08-2007 14:13

Re: Teach me?
 
Quote:

Originally Posted by Roger (Post 639187)
Can you guys point me in the right direction to do VEX with MPLAB? Is it the same MPLAB as the FRC robots but with VEX-specific code? I actually had some project ideas for the VEX and, yes, I could be using EasyC but... Well, we'll leave that debate alone.

start here;
http://www.vexlabs.com/vex-robotics-downloads.shtml

aaeamdar 19-08-2007 21:24

Re: Teach me?
 
Quote:

Originally Posted by AdamHeard (Post 638995)
I know a lot of programmers avoid EasyC because it's easier and they don't want their ego's hurt, but c'mon, it's a win/win situation. The code is done quicker, with less chance of syntax errors. And if you don't believe complex things can be done with it, look at team 40; they program entirely in easyC.

Adam,

While EasyC may not limit you at all for FRC (I've never tried it, only done it the normal way), it seems to me that if one relied on it consistently, this might hamper development of actual programming skills. While this may not be of any concern if you just want to program something and get it done and over with, if you are seeking to develop these skills, it might be better to build from floor 0.

-Paul

ebarker 19-08-2007 22:10

Re: Teach me?
 
Easy C is useful to do 2 things. a) teach basic control flow and algorithmic processes. b) get a non-programmer started and through an FRC season.

If any of the following conditions are true, then you should be migrating to MPLab tools as soon as you can.

1) If you are going to major in engineering, computer science, or science.
2) If you need to do professional grade embedded programming.

One book that I like for teaching 'C' is the following:
http://www.amazon.com/Sams-Teach-You.../dp/0672324482

Note that it is NOT the 'C++' book but IS THE 'C' book of a very similar name.

Then you can download this from Microsoft:
http://msdn2.microsoft.com/en-us/express/aa700735.aspx

It is the Visual C++ Express. For this educational experience you will NOT do c++ but c programs inside of Visual Express.

After installing Visual Express you should register it. It is free and easy.

Then go File->New->Project->WIN32 Console Application
Call your project 'demo' or whatever you like.

then do a Control-F5 and compile and run it.

Now you are ready to do a 'hello world' application, which starts on about page 29 of the book.

At some point you will need to master everything in the book in your college career.

But, there are several things that will not be done in an FRC controller, like calloc(), malloc(), disk I/O, probably not sorting/searching, linked lists.

Do your 21 days and then it will be time for the next step.

Salik Syed 01-09-2007 17:25

Re: Teach me?
 
If you want to learn programming ... I think you may want to actually learn on something other than the robot.

The robot introduces alot of extra stuff that doesn't really help in getting people to think like programmers.

I suggest using either Python or Ruby. These will make it easier to write simple command line programs and start thinking logically. They are very easy syntactically, there is no compiler or useless overhead stuff needed either.
Just download the interpreters at :
http://www.python.org
or
http://www.ruby-lang.org/en/

I'd also suggest getting a book on it.

Once you can do simple (or complicated programs) move over to C. As far as programs ... just make stuff you want... try making a simple board game or something.


-Salik


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

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi