View Full Version : learning programing
Dakota Snow
25-11-2006, 16:30
our team has almost all new members and all of our programmers left this year. I need to teach our team how to program but I only know the basics. I need a good way to teach my team. HELP!!!!!!!!!!!!!! :ahh:
Maybe you should use EasyC this year. I havent used it yet but i hear teams with no programming knowledge have used it with ease. There are some PowerPoint slides on C on usfirst.org. Have them get knowledge of C before the season starts and learn the default code.
In terms of actually learning C, I'd recommend hitting up something like Topcoder that has a bunch of tiny challenges to do. The 250pt challenges are about the same programming difficulty you'll encounter programming the robot, and give you something to work towards as well as objective accomplishments (say to them "each of you complete 5 250pt practice room problems"). You can view other people's code in the practice rooms, so if you're ever curious about syntax there are lots of examples.
Basically, I find that in order to learn, you need something to make. Basically anything will do, but Topcoder supplies the 'something to do' without it being too difficult.
http://www.topcoder.com
Actually programming the robot on a basic level isn't terribly difficult. You just modify the values of some variables (pwm01,pwm02,pwm03...) between 0 and 255, and like magic the motors turn.
efoote868
25-11-2006, 17:10
teaching others programming is really difficult... its something that must be experienced. I found that learning programming through the edubot was fun, and that it couldn't go on rampage and kill people :p
theycallhimtom
25-11-2006, 18:25
I think when teaching people to program get them testing on a robot quickly. Personally I love competing in TopCoder and practicing for it but I'm not sure if students will be that interested in TopCoder problems as they usually are pointless problems. What we do is start with some basic simple problems that involve the robot. For example make two joy stick drive and then one joy stick drive. Start very simple so they students can easily get something done then expand from there. I haven't tried easyC (it crashed first few times I tried) but if that works go for it.
EHaskins
26-11-2006, 11:55
Look here http://www.usfirst.org/robotics/C_help.htm. The power point files are fairly good. If you watch those you should be able to make you robot move. If you want your robot to use any sensors look at kevin's site www.kevin.org.
If you have any wuestions e-mail me. :D
Mike Betts
27-11-2006, 13:30
Dakota,
I have had mixed success in using this excerpt (http://www.lysator.liu.se/c/bwk-tutor.html) from The Bible (http://www.amazon.com/C-Programming-Language-2nd/dp/0131103628/sr=8-1/qid=1164651053/ref=pd_bbs_sr_1/104-9608147-9935166?ie=UTF8&s=books).
Some students respond to long lectures, most fall asleep. As such, I assign about 40 pages of the tutorial as a reading assignment and answer questions the students have on the reading. I also give a few supplemental lectures on bit manipulation, integer arithmetic, state machines and interrupts (all of which are non-C specific topics).
In parallel, I try and get the students to program as soon as possible. I have found the VEX system to be a great platform for this (I totally agree with Foote in post 4). Make their first task as simple as possible. Even reversing the direction of a motor will boost their confidence immensely. As soon as they get their feet wet, most will wade into the water with little more encouragement.
I would also suggest that you steer away from EasyC. C will be a little harder on the front end but much easier in the long run.
I have not encountered an 8th or 9th grader who was unable to learn C to program a robot if he or she gives it some effort and has a resource to ask questions of. If they are unwilling to read 40 pages, I don't think that there is a tutorial in the world which can help.
Good Luck,
Mike
RKElectricalman
27-11-2006, 14:23
Oh man, you're in the situation, that I was in about 3 years ago, as a rookie on my own team! :ahh: I know it's not a good feeling, when the newer guys have to learn, and they're your backboard, because It was never a good feeling, going into build season knowing so little about programming, for me.
Learning to programming isn't always going to be simple, it's fairly hard, and the best way to learn trial and error. You have to teach them by letting them try it first. Set up a prototype, and give them simple task to accomplish such as getting the robot driving. Obviously you have to give them a background for it first, so you show them, let them look over your shoulder, give them a few pointers, and let them on there own way to try some coding! If you don't let them try, but instead just teach them, they'll think they know it all, and when they're finally need it they will run into as many problems as possible. Brown's Rule : Anything that can go wrong, will go wrong; and trust me I've been through that.
Let them experience all types of sensors, inputs, outputs, and operators. The more they KNOW they can do (with actuall testing) the more of the picture they can put together, and slowly they'll piece the picture together. ;)
Since you only have a basic understanding, this is an awesome opportunity for you to learn alongside them. This way all of you will really be at the same par. :D
Jimmy Cao
27-11-2006, 18:29
Programing is a hard thing to teach. I myself was never "taught" programing by any person or group of people. I took the initiative and read books.
First of all, I do not like the way Easy-C works, maybe it's just because i'm too used to normally programing. I tried to use Easy-C to program a Vex robot my team made, and it was very confusing. I could not figure out how to replace a if statement with an else if statement. Eventually i just programed it in MPLAB. So, point of the matter is i would not use Easy-C unless you have no other alternative.
I believe it will be extremely difficult to program if you do not want to learn. If the willingness to learn is there, then either find a quick online tutorial or a nice little book and go through it.
For simple programing, logic is the hardest part to understand. Learn to organize your code, and use comments to keep yourself/others nonconfused (is that a word). The syntax isn't too hard to learn for C, it's just a lot of memorization.
After getting past the basics, having a nice creative mind do your programing is nice. It's nice to be able to look at a robot (or a concept even) and think... "If I want this robot to do such-and-such, then I should program such-and-such functions".
Lastly, a quick tip. ALWAYS keep your complicated code organized. Especially when making long functions (Like our PID for the camera aiming system last year) it can become very easy to forget what each line does, making it impossible/almost impossible to debug.
Tom Saxton
27-11-2006, 20:28
Here's a link to some programming tutorials my wife (and fellow mentor) created to teach our students the basics of programming in C. She taught AP Computer Science for several years and used that experience write tutorials to get new programmers started.
http://idleloop.com/tutorials/introC/index.php
There's still some more work to be done, but we've had good success using these materials to train a new crop of programmers this year.
The tutorials intentionally avoid using C++ features that are not available when programming the robot, and everything is very platform agnostic for the same reason.
You learn to program by doing, not by reading, so read the materials, work the exercises and try the "further explorations." Once you get through the tutorials, you'll know enough about C that you can learn the specifics of programming the FIRST controller.
The kit of parts comes with sample code to get started and there other good sources of sample and library code on Chief Delphi. All of that will make a lot more sense once you have the basics of C down.
I'm always happy to answer questions about either the tutorials or programming the FIRST controller.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.