Wednesday, January 14, 2009

Working with leGOS

As I said in the last post, I started by getting the firmware downloaded to the RCX unit. That was successful. I then continued on in the tutorial by typing out the testing code (in Notepad ++ of course). The typing out went fine ;-).....Things are looking grand....then comes the "head banging error" you know the type....."Why are you giving me that? I "thought" I followed everything to a T"....Very well time for....Google....What errors did I get you ask? Well lets see.....

  • Can't find the lejosjc.bat Problem: setting the variable properly
  • Can't find javac (being called by the lejosjc.bat) Problem: once again setting a variable properly (Can you tell that I typically don't have to do that all that often?)
  • javac: target release 1.1 conflicts with default source release 1.5 Took the error code and used our good friend Google....came upon a website that suggested using leGOS 3 (which according to the website is a release candidate...), I unzipped the downloaded zip file and copied the new files over to the original legos folder. (Note: I did not delete out everything from that folder but just told it to replace what had the same name with the new data)


(I do realize that it is somewhat hard to read the lovely command line picture....but I thought that I would go ahead and add it. I also realize that the user name is blacked out...that is to protect the identity of the computer ;-))

I then reset paths and this allowed me to "compile" the program. I did run into a small error, but that was a typing error on my part. After finding said error, fixing it and saving the file. It compiled for me quite well.

Now comes the part when we download it to the RCX unit, Right? Of course not....now comes the time where we go back to trouble shooting because we get more errors....
What error(s) are we getting you ask?
"error while linking: No classes specified"
Google here we come....
To solve this lovely little error, I have tried putting in the CLASSPATH (again) and googling it. I have yet to find the fix on Google. And that is where I am now...thinking that I would possibly get to stop with success and yet getting to puzzle it over....

The JOYS of Programming :-D

Time since last post: 1 hour 45 minutes
Overall: 29 hours 25 minutes

Moving Right Along......to JAVA

Just thought that I would update everyone out there watching the blog that I am now starting to work with Java for programming the RCX. I have set it up and downloaded the firmware to the RCX, now on to how to program in the RCX. I am following the information on this site. The leGOS from what I can tell provides the tools so that the RCX can understand the java bite code. I have begun by using the tutorial that is provided on the website.

Time since last post: 50 minutes
Overall: 27 hours 40 minutes

LucyLeia

So yesterday after posting on Luke, I broke him down and built up a new Robot: LucyLeia. Her purpose in life is to sort 1x2 Lego bricks by color. Depending on the color depends on which side she puts them on and what sound she makes.

Here is the main component of her. On the top is the motor, which moves her arm. The next brick with the wire, down is the touch sensor, which allows her to figure out where the holes are in the arm to all the Lego bricks to slide through the arm and move them to one side of her or another. The bottom wire in the picture is the light sensor. It is this sensor that allows her to figure out which color the brick is. The light sensor has a red LED that provides constant light, so by making the dark tunnel, the light sensor readings should be pretty close each time.

Here she is on her stand which allows the bricks to slide down, hit the light sensor, which activates code to move her arm and make the right noise.





Here is a video of her in action. (Make sure that the volume is on so that you can hear her make noise) ;-)


video

The coding of LucyLeia was in NQC. One of the interesting things about her code that I found, was that Baum took advantage of the NQC code and used "toggle" to move the arm in the opposite direction, after it had dropped the Lego. Because I ran into problems with some of the 1x2 bricks in the Mindstorms set, because of holes, I brought some of my own in. This provided me with the opportunity to use more than two colors of bricks. To see if LucyLeia could tell the colors a part, I programmed her to make certain sounds, depending on the color of the brick.

Time worked since last post: 2 hours 30 minutes
Overall: 26 hours 50 minutes

Blogger Templates by OurBlogTemplates.com 2007