Learning Java with leJOS

Post your NXJ projects, project ideas, etc here!

Moderators: 99jonathan, roger, imaqine

Learning Java with leJOS

Postby Phoen » Sat Feb 02, 2013 9:10 pm

Hello,

I'm a pretty new NXT-Developer with not much experience. I have to build a concept of how to learn Java unsing leJOS at University. For simple program structures like drive-throug-a-labytinth-programms it is easy to find an exercise. But by the time the lecture passes object oriented programming it's hard for me to get (usefull) use cases which can be put in an exercise.
I've lent serveral Lego Mindstorms Books for my libary only to discover that none of them cover leJOS.

Can anybody give me a short example, so I can get new ideas from it. It schould not be too complex so a student can use it to understand how object oriented programming works.

Thanks in advance,

Phoen
Phoen
New User
 
Posts: 10
Joined: Sat Feb 02, 2013 11:07 am

Re: Learning Java with leJOS

Postby skoehler » Sat Feb 02, 2013 9:22 pm

Do they have to start from scratch with leJOS? Learning what a for or while loop it doesn't become easier, if you have to upload the programs to the NXT everytime. And then, there is this tiny LCD, which has its own pitfalls (students often use LCD.drawString or LCD.drawInt instead of System.out.println. And then they wonder why the screen says 900, when they printed 300 and 90 to the same coordinates on the LCD without a clear). Then they struggle with simple facts like that the values returned by sensor can have noise, and so on.

So if it has to be leJOS right from the start, use simple sensors (like the touch sensor) and some motors, and let them play around. Maybe they should learn simple concepts like classes, object, loops, etc. beforehand by writing Java programs that run on the PC.
skoehler
leJOS Team Member
 
Posts: 1431
Joined: Thu Oct 30, 2008 4:54 pm

Re: Learning Java with leJOS

Postby Phoen » Sat Feb 09, 2013 9:24 pm

Hello skoeler,

sorry that you had to wait so long for my thanks. I read your post, and wanted to answer but unfrotunately I forgot, because I didn't do it immediatley. As I had another question today I saw this post again.

Thank you for your answer. Sorry for the late response.

I'm now planning to make a MyRoboConfig class, where the students make robot objects with certain preferences (e.g. 2 motors and no sensor, 1 motor and 1 touch sensor...)

Regards

Phoen
Phoen
New User
 
Posts: 10
Joined: Sat Feb 02, 2013 11:07 am

Re: Learning Java with leJOS

Postby roger » Thu Feb 14, 2013 7:28 am

Hi Phoen,
I have been teaching a course for several years now that uses Lejos to teach students Java. The course material is online at
http://sage.cs.berkeley.edu/
Click on "Introduction to Industrial Mobile Robots fall 2012 " and log in as guest. Feel free to use anything you find there that might be useful.
Roger
roger
Moderator
 
Posts: 368
Joined: Fri Jun 01, 2007 4:31 am
Location: Berkeley, CA

Re: Learning Java with leJOS

Postby Walt White » Mon Feb 18, 2013 2:35 am

Hi Roger,

Thanks for offering this. The course information shows that your office is in Etcheverry Hall. I earned a Bachelor's Degree in mechanical engineering from Berkeley in 1974 and took many classes at Etcheverry Hall back then. I worked for thirty eight years and retired a month ago so now have more time to devote to leJOS programming so it's kind of fun to see things back to where it all started, in a coincidental way.

I created a new account, and found:
Steam\ieor140 holds all the course software, sample code, and copies of most of the documents on the web site. You should map this folder as a network drive Z on you lab computer.


Is there any way to get access to this material? Or can we follow the course well enough using the textbook?

Walt
Walt White
Novice
 
Posts: 44
Joined: Sun Aug 06, 2006 11:57 pm
Location: California Central Valley

Re: Learning Java with leJOS

Postby roger » Mon Feb 18, 2013 7:15 am

Hi Walt,
Welcome back virtually to Etcheverry.
The text and the course web site have just about everything you will need. The Steam server holds versions of the java, lejos, and eclipse software which I assume you already have or can download your own. I also use the server for student's completed homework and group project files to be graded.
Good luck, and let me know if you run into problems.
Roger
roger
Moderator
 
Posts: 368
Joined: Fri Jun 01, 2007 4:31 am
Location: Berkeley, CA

Re: Learning Java with leJOS

Postby eriknau » Tue Jun 11, 2013 12:43 pm

This is an amazing resource. Thank you for posting it!
eriknau
New User
 
Posts: 13
Joined: Mon Jun 10, 2013 7:33 pm


Return to NXJ Projects

Who is online

Users browsing this forum: Google [Bot] and 3 guests

more stuff