Teach programmers

I am going to be head programmer next year and part of my job will be to teach new members interested in programming. I was wondering if people had any ideas on how to effectively teach programming, since I am not a great teacher (took 20 minutes to teach my brother how to play checkers :rolleyes:). Any thoughts would be appreciated. Many thanks.

Prepare lots of hands on exercises. Start with normal desktop programming for simplicity, but make sure that you quickly move to actual robot code. You’ll need a lot of time if you actually want to make these people good.

Most of the specifics depend on the language you use.

We use labview to program, but many of the members come in knowing C/C++ or Java.

I generally start them on the FRCMastery videos, then have them do a traffic light state machine outside the robot code, then move a robot motor with a joystick or button in teleop starting from the base robot code, then work up from there.

If your incoming members are strong, really strong, in C++ or Java, you might consider switching to that for your programming language. It’s a lot easier to learn to program if you’re only learning the logic of programming a robot and not trying to learn all the syntax and quirks of a new language as well. Then too, labview programming is rather different than C++ or Java. As an experience C++ programmer, it took me quite a while to really get my head around labview and how it works when I first encountered it.

Team RUSH has developed labview programming documents and we distribute them to rookie members as well as rookie teams and they said it really helped

http://archive.teamrush27.net/resources/rookies.html

they are the programming guides under labview tutorials

Good luck
Matt Pasco

Could not open the links. They led to a page not found error…

This year, we had 2 new programmers who knew nothing about programming. They ended up writing most of the code. The only thing that they didn’t write was the PID loop code, as no one on our team knew how to do that before this season.

First, we had them come in for a couple hour long sessions after school in which we (the other veteran programmer and I) explained variables, subVI’s, control structures (case structure, while loop, for loop), and other basic programming stuff in both technical terms and more relatable terms (We ended up with a huge extended analogy comparing a room full of magic boxes to the code). We then had them come in a longer after school session in which they wrote tank drive code during which we explained what the subVI’s are supposed to do (why do I need to initalize a motor, etc). Next, our programming mentor took a day to make a water tank state machine with us. We then sent them home to read ni’s tutorials on whatever they didn’t understand. To get the new programmers programming, we had a policy that a new programmer must always be sitting in front of the programming laptop, with their screen projected on the wall. We started off by talking them through everything (Click here- that VI you just selected allows us to set motor output, etc), and eventually moved up to them programming almost independently. Because we had a bench to test on, all of our teleop code was done, tested, and theoretically working by the end of week 4. The only things we’ve done since there were changed negative signs, ports, and added a PID loop.

tl;dr: Use hands-on activities.

Thanks guys. I have been working on “tutorial code” that contains basic functions such as loops, variables, etc. Hopefully these will help me teach people without overwhelming them.

this is something we’re looking at using to learn Java. It’s “virtual” battle bots using Java or .NET It allows for programmers to just focus on code without the hardware problems. Haven’t tried it yet though…

http://robocode.sourceforge.net/

I’ll also ditto the above that say if you know C++/Java, why not code your bot with it?

I second (“third”?) the importance of teaching state machines once basic programming and control structures are understood. State machines are not language dependent and they are useful for robot programming. Part of our fall programming training is having the programmers (new and experienced) write code that implements a given state machine.

This page is probably the one Matt should have given:
http://www.teamrush27.net/rookie-resources

Thanks for your input. Me and the other veteran programmers have made an executive decision to switch to C++ and are already happy with it.:smiley:

For C++, Team 2704 has developed a training program for FRC that uses NXT robots. The training is directly applicable to FRC robots, but each student can program their own little robot. So if you access to NXT(s), check out www.FirstPlusPlus.com

Wow, this is really great work. thanks for sharing!

It depends on your goal.

If your goal is to teach how to program an FRC robot in the least amount of time (in order to allow for testing of various components as well as driving practice), teach them LabVIEW. There are many free resources available as mentioned earlier in this thread. The teamrush27 programming guides are exceptional. See
http://www.teamrush27.net/rookie-resources

If your goal is just to teach programming skills, go ahead with either LabVIEW, C++ or Java, but expect to spend months on the Java/C++.

Contrary to popular belief, there ARE many technical programming jobs available using LabVIEW. (Search on labview job colorado since you are in Colorado.)

I found myself in the same boat recently.

If you use java, a great thing to teach basic syntax as well as basic algorithmic thinking is coding-bat (www.codingbat.com).

Seeing as we have more time before build season starts, I also plan on wokring with the rookies with general java programming, as I feel that people who understand how to program in general are much better than people who can just program for robotics.

It may work to your advantage to work with new members on coding styles/practices as well, there’s nothing worse than a religious war over tab sizes ruining your productive day.

Good luck! :slight_smile:

A followup to a previous post. There is a Java option for the NXT too. Check out www.lejos.org. I don’t have any direct tutorials for this, but I’ve used it with success on personal projects.

Mr. Tim Klein
“Code Guild” Mentor
FRC Team 3966 STEMpunks