Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Technology

Fun with LEGO Mindstorms Programming 183

rhempel wrote to us about an interesting LEGO Mindstorms programming tool he's created called pbForth. Click below to learn more about it - but let's talk about Mindstorms programming in general. What else is everyone using? What's the coolest thing you've done with them?

I've developed pbForth, a port of a rather archaic programming language, for the LEGO Mindstorms brick. The cool thing about it is that with a dumb terminal emulator that does ASCII uploads and can handle XMODEM (checksum) transfers, you can compile applications right on the brick! Yes, on the brick! When you are done, you blast S records back to your PC using XMODEM and then you can reload the app anytime using one of the standard firmware uploaders.

Check out pbForth for LEGO Mindstorms

pbForth got a whole chapter in the O'Reilly book, and it is getting more and more momentum as replacement firmware that busts the 32 variable barrier, and allows total cross-platform development without screwing around with building ecgs.

OK, I'm biased - I wrote it - but I think it's cool. Maybe some of you LEGO gearheads out there would like to try programming in something other than the native tongue. Learning Forth can make you a better C programmer. No, I'm not a Forth evangelist - I write embedded systems in C all day long.

This discussion has been archived. No new comments can be posted.

Fun with LEGO Mindstorms Programming

Comments Filter:
  • Isn't Fourth the only other language besides Fortran where you can redefine the value of four?

  • by DrPsycho ( 13308 ) on Sunday January 02, 2000 @01:30PM (#1414575) Homepage
    If Forth (or in this case pbForth) can be adapted to program the LEGO Mindstorm bricks, what about other programming languages?

    I for one would love to see Perl for LEG0. Do any such extensions for Perl exist, or are they in the works? Could other languages be adapted for LEGO? Forth is admittedly rather archaic, and few people program in it any more. Might open the appeal of the Mindstorm to a greater community.

    Oh. Who am I kidding. Every geek wants LEGO. :^)

  • An X Windows terminal made out of legos... hmmmm. Well, the Etch-a-sketch models worked real well when we deployed them into Sales... =)

  • by Khan ( 19367 )
    While I'm still new to the LEGO Mindstorms field (just got it for Christmas) I have found that NQC is a really good for programming that lil "brick". So far, I've only been toying with the ones that come with the book. But, I'd certainly like to make a few fighting robots. I love to watch the pieces fly off ;)
  • I've always loved LEGO (since I was 5 or so) and when if first heard about Mindstorms I almost went insane. I've bought that they-say-it's-programmable-but-in-fact-it-isn't control station but when I first started programming (when I was 12) that just didn't attract me any more.
    After all, I'me glad I started programming C, but lego still has a 'special place in my heart'. This slashdot article brought the entire feeling back. It makes me want to run to the nearest toy-store and buy that Mindstorms set. (too bad it's sunday and 0:34 Am ;).
    Can anyone tell me how far this Mindstorms-programming thing goes? Might it actually be possible to create your own Aibo?? ;)) (those things are neat!! :)

  • i remember the story about the expensive robot maids, etc, and someone saying that these guys are just as useful. i havent had a chance to check them out, but im wondering exactly what they are capable of. the backs of the display boxes are pretty lax on information.

    i would gladly spend a hundred bucks for something that can retrieve the remote control for me.
  • I, for one, do not want to see perl on legos. While the string handling is really great, it's a write-only language. I mean, with the standard legos you can take them apart and reassemble them in chunks... but with perl, once you assembled it the nanobots would come out of the controller box and glue everything together. Write-only legos... oi.
  • The reason tools like this are so important are of course variables. I mean what programming language is complete without something as basic as variables? Unfortunately, the default mindstorms "language" doesn't really have variables, and we had to pull off some rather absurd tricks in my high school robotics class to emulate them. It was unfortunate that the teacher wouldn't let us use something different like pbForth. I don't know what his problem was :(, then again he also loved NT.

    I think I'm going to try and convince him to use pbForth for future classes, anyone know of other schools (highschools in particular) doing such a thing now? Our problem is that the classes primarily contain normal students with no programming knowledge, so this might sharply increase the learning curve. Any ideas on how to make programming simpler to the non-geek/techie?
  • im waiting for LEGO QBasic
  • That is my first programming language. Very cool and very extensible. I am very happy to see it still alive.
  • My little brother has been playing around with Lego Mindstorms for quite a while, and he just got the Official and the Unofficial (O'reilly) books on the little robots. One of the books came with a CD containing a compiler called NQC, or 'Not Quite C'. As a linux hacker (not cracker), this caught my eye. Apparently it comes with a small compiler that is capable of compiling C code (or at least stuff that looks like C), and then sending it to the RCX (central part of robot) for use.

    I would like to know just what the capabilities of this little compiler are. Has anyone used it? Does it come with a fully functional set of libraries? If so, this might be a rather useful (or at least fun).

  • (Forth, you mean)

    You can also set your output to base 3, or 9, or 37!

    (You can even set it to base 1, but don't expect to get an answer real soon...)

  • Funny thing, LEGO said they'd never make 'war' toys :o)

    (offtopic: what about all those new product lines
    where there's one 'house'/ 'clan' / whatever fighting against the vile Bogons over some mineral ?)

    Anyway, isn't there some limitation on that brick thing? I can't remember ever seeing it do more than one thing at a time...
  • Perl is much like Lego... you can put almost anything almost anywhere. Just instead of innies and outties Perl has lots of punctation and even more context.
  • by morven2 ( 5718 ) on Sunday January 02, 2000 @01:46PM (#1414591)
    Perl is NOT suited to embedded programming. Perl is huge. A Forth interpreter is tiny, and Forth bytecode is tiny. Forth was written for embedded systems.

    Perl is best suited to larger systems, as a good method of tying together the extensive resources available on such a machine. It's just not suited to a tiny system.
  • For my money I pick NQC [enteract.com]! There's ports for Linux, Mac, and Windoze.

    If you use windows try Mark Overmar's RCX control center [cs.uu.nl]. It's a keen IDE with a bunch of other kewl features like remote control, var watches, and more!

  • by Anonymous Coward
    Your lucky to have a high school computer teacher who even knows anything about computers. Ours is constantly stoned and preached karel++ all day long. Ugh!
  • I want to get Lego Mindstorms, but over a $100 for
    Legos just doesn't seem right to me. Can anyone
    (Who owns them) tell me if they are worth $100?
    What can you do with them? If they would go down
    in price I would buy them right now. I fell anyone
    that spends over $100 for legos, needs to check
    their priorities. Sure they are neat but you could
    get stuf for your computerwith that money. For
    that much money you could get more RAM, a burner,
    speakers, zip drive...etc..

  • Yes, but that's a feature, remember. They designed it so that all programs could be forwards compatible if the value of 4 ever changes (which is good, since the ISO is now working on the Number89 standard, which is characteristically several years late (C9X, anyone?))
    ~~~~~~~~~
    auntfloyd
  • by Fastolfe ( 1470 ) on Sunday January 02, 2000 @01:54PM (#1414600)
    Firstly, legOS is a really cool project. They've totally re-written the firmware for the RCX and built a fully pre-emptive multitasking environment running programs you can write in C or C++ and compile with a gcc cross-compiler. Very cool stuff, though the networking support (IR) doesn't seem very usable just yet.

    NQC uses the standard firmware I believe, and is a bit more solidified. You write programs in a pseudo-C language and compile/upload it using the NQC utility. It also has some good IR message passing abilities.

    Information about both of these can be found at LUGNET [lugnet.com] in the robotics section.

    I experimented with LegOS a while back but ended up using NQC and a bunch of server-side Perl to build myself a telerobotic camera [fastolfe.net] mount for my webcam.

    There are definitely tools available out there for some extremely flexible Mindstorms programming.
  • by giberti ( 110903 ) on Sunday January 02, 2000 @01:56PM (#1414601) Homepage

    As with any great toy, there are limitations, but here is the low down for thoes who dont know about this little toy yet...

    Out of the box its a PLC type system with three in's and three out's... It comes with two motors, two on/off "touch" sensors and one ir sensor... It also has (but not talked about) its own built in IR sensor which it can use but requires using some slightly more advanced programming languages than the one included.

    There are all types of Visual Basic programs available, but thats all I have seen so far. The lego site talks briefly about it I belive.

    There are also add ons available for it... a heat sensor, a rotational sensor and of course more motors.

    The toy is pretty nice, but really requires some patience engineering the remaining bricks to do what you want, and as always, if you dont have some legos already, you will want to go and get a few kits, because you will be limited despite the large quantity of bricks included.

    Hope this helps clear some stuff up.

  • But when you have all the computer toys you want, and the ones you dont cost far more than a few hundred dollars, is it not worth it?
  • Has any one got this? I saw it at future shop before christmas and it was about half the price of the main mindstorms set. Is it usable stand-alone or do you need the base set. Can it be programed?
  • Or, maybe it's just playing, with toys?
  • This is a really important feature. You never know when the apocalypse will strike and the number 4 will simply cease to exist! Or if 8 and 9 suddenly vanished, and we were all forced to change the entire world to octal!
  • Aren't you being a bit hypocritical, hanging out here on slashdot? You're basically espousing the idea that any kind of technological advancement is bad (because it's all creative, after all). So why are you on a computer?

    Or perhaps you could look at it the other way - that by creating things, we're honoring the Creator (imitation being the sincerest form of flattery and all that).
  • by miahrogers ( 34176 ) on Sunday January 02, 2000 @02:11PM (#1414609) Homepage
    I was in the Penninsula Robotics Competition here in south eastern Virginia. We(my school's team) had to build a robot that would drive around a rectangular course and collect small white wiffle balls.

    Programming for the Mindstorms robots isn't very hard. However there are many other problems with them.

    For one you are only allowed to have three engines on a given mindstorms robot. I guess i should more accuratly say that you are only given 3 power terminals to plug your engines into, you may plug in more than three engines, but then two of them must go in the same direction.

    Another problem with the mindstorms robots is that they don't allow much room for a "smart" robot, as you are only given 3 sensors (like the engines above you can plug in more than three sensors but then two of them must respond to the same stimulus).

    Also the strength of legos in general is much worse when you try to put legos and a moving vehicle into one. Your building style will have to be entirely reformed if you plan on keeping your mindstorm alive for more than 10 minutes. The technic legos help with this a little, because they are longer and contain those neat axle shafts which we used liberally. But overall if you decide to change anything on the robot it will have to be entirely rebuilt for strengh/durability reasons.

    The last major problem with mindstorms robots is that they cost way too much. For a kit including three engines, a bunch of legos, and one cpu unit(basically the bare minimum you can get by on if you want a robot that moves), it was > 500$.
  • Next thing you know, they'll create a cheap linux distro for Lego, and have an IPO. Viva linuxone!

  • Don't feed the Trolls kids!!!
  • Sounds rather hypocritical to me, Mr Flamebait.
  • by Poppa ( 95105 )
    That price quote is out of line. Unless that is the educator's special ..

    The standard system costs $200 in the US, with over 700 pieces including the CPU (RCX). Only two motors are in the kit, another motor costs about $20.

    Robotics are expensive, Legos are expensive, but this isn't that bad a deal.
  • that price quote was what it cost for those legos about a year ago. I was told the legos cost about $530. I wasn't aware the price has changed that much, i stand corrected.
  • C99 was ratified a couple of months ago (November, I think), and some posters on comp.lang.c say it was published a few weeks ago.
  • When I was in highschool, we had a lego robotics course that used Apple II's with a language that resembled BASIC and C rolled into one, TC/LOGO/LEGO, I made automatic weapons in that class, those short axles have good trajectory ;>
  • by Hrunting ( 2191 ) on Sunday January 02, 2000 @02:37PM (#1414630) Homepage
    I live in the same apartment as this webcam and actually built the camera-holding assembly. Being the humble dood that Fastolfe is, he fails to go on about some of the actual features in this webcam.

    The assembly is built solely from the parts that I received in my Mindstorms kit a year ago (no add-ons, no extra sets). One motor runs the manages the rotation in the horizontal direction (spin) and the other manages rotation in the vertical direction (tilt). The whole thing sits about 8 inches high and the RCX unit does not form part of the base (we have it slightly separated since the IR signal comes from another computer across the room).

    The program keeps track of spin and tilt so that users can't spin it all the way around (tangling up the cord in the process) nor can they tilt more than 90 degrees in any one direction. The program also allows a certain point to 'marked' as the initial starting point for the tracking, and there's a handy reset feature (not available outside the internal network). He also wrote the telecam daemon that resides on my Linux box that handles the actual control of the webcam (the web stuff is on a different server).

    Streaming is handled by (*gasp*) a Windows program, Webcam32, that actually came with the Java code necessary to the streaming. It was a nice little package. Fastolfe is currently in the process of writing his own program for Linux that will use bttv or something similar to do the same thing, but for right now, it's working pretty dandy.

    Setting this thing up isn't very difficult. Of course, with the post to Slashdot, it's getting hit pretty hard, but the great thing is, that we've gotten more feedback about potential problems (as Fastolfe said, "Finally, someone who knows how to open their Java console") in the past five minutes than we've received since we put the thing up.
  • I got my mindstorms kit a while back but i havent played with it a lot recently. I know 300 bucks (canadian ;) is a lot to spend but i think it was completely worth it since i have quite an investment in a lot of other technics lego kits. Now i am able to use all those pieces to make tonnes of stuff!

    I tried using the RCX software which came with it (under emulation on my mac) but it was deplorable.. not just slow, i found it icky to use. I tried using RoboLab (the software used in the educational market from Dacta) but that was graphical too! I finally chose NQC and so far have found it the most useful. Theres just something about whipping out a bunch of code and compiling it ;) rather than dragging a bunch of icons together and hitting 'SEND' (imho).

    the last thing i remember making is a garbage dump truck which used sensors to pickup and empty a garbage container, then drive away.. (wasnt my idea, i saw it on the web) but it was my implementation. The next thing i want to make is a wicked sports car with a rack & pinion steering and a gear box. Check out Ben's Lego Creations [staticip.cx] for ideas. He has some really neat designs.

    i also recommend the new david baum book (he made NQC) for general programming and lego design issues. I love this book. Check out his site [enteract.com].

    cheers,
    nitin

  • Nope, as I don't have Text::Clever installed.
  • My congratulations to Ralph on pbFORTH. It appears
    to be a great alternative to the Lego firmware
    in providing more granular control of the RCX and
    in its functionality. I especially enjoyed the
    ability to try out commands on the fly via a terminal (without having to compile or write a
    whole program first).

    At this time, however, I find I'm spending more of
    my time in NQC. It's a fantastic tool -- very C
    like and feature-rich. I find I haven't really
    run into a situation yet where pbFORTH's extra
    functionality has been required (and consequently
    the installation of a firmware different from that
    which came with the RIS).

    Ultimately, I'm not sure I need to spend the time learning FORTH, just to play with legos.

    Last, I have no opinion of legOS, since I haven't
    tried it yet. It looks very cool, though.

    It's probably worth mentioning that most of these
    alternatives are due to the reverse engineering
    of the RCX done by Kekoa Proudfoot:

    http://graphics.stanford.edu/~kekoa/rcx/


  • Closest we have to computer teachers are the new teachers that teach typing and QBasic.. Yes, QBasic... *shrug* Oh! And our AP Physics teacher doesn't like physics.. He majored in Zoology in college..

    Daniel
  • In my Netscape, it's under 'Communicator | Tools | Java Console'. Under my IE4, it's under 'Internet Options | Advanced'. Setting that setting there will enable it in the 'Tools' menu.
  • I wanted to buy the mindstorms kit for prototyping purposes but there were too little acutator an sensors that could be fixed on the RCX.

    I was thinking a system in which multiple sensors/motors were linked via a bus would be more useful - I wonder if the RCX can be programmed to do that.

    By the way, has anyone managed to build a lego based laser guided bomb yet?

  • Haha! The fundament in human anatomy is the lower part of the body; the butt-cheeks. In ornithology the fundament is also called 'the vent...' Kind of a double entendre I suppose...
  • I like to make Beowulf clusters out of 'em!
  • granted, that for over 100 it was kinda high priced...i just bought mine saturday. It was actually over 200 for the full mother load set, and then for 6 AA batteries and a 9 volt. As with some other ppl, i havent touched legos for several years and have been working basically out of the book for the models for now, however they are fun to play with, i have yet to make anything productive with them, though i do feel that over time its possible (just make sure you have some old parts to through in if u want to get creative... They're expensive, but there fun lil toys
  • by Ptolemy Too ( 124866 ) on Sunday January 02, 2000 @03:20PM (#1414647)
    I have a bit of a bias, here: as a programmer and a homeschooling [midnightbeach.com] dad, I've long wanted to write a good Intro To Programming book. I thought Mindstorms(TM) might be a good medium for that. But it's not: Doing anything with Mindstorms(TM) is as much (or more!) mechanical engineering as programming.

    At first I thought, oh, that's OK. That still involves problem solving and working with constraints, yes?

    But what constraints! Forget any notion of building Rodney Brooks [amazon.com]-like robots: You get three sensor inputs. Even if you were willing to spring for lots of extra-cost sensors, and used some clever multiplexing schemes, you'd be hard pressed to build an insect that could even know whether its legs were up or down, forward or back.

    And seemingly simple robots have a way of using up the parts that come in the standard set. Once you've built a track following robot, what do you do with it? You've used up both motors. Similarly, once you've built an arm that can raise/lower open/close its claw, you've used both motors, both touch sensors, and most of the gears and structural pieces.

    I'm afraid that I lost interest pretty quickly.

  • I would also like to see perl available for LEGO, however it would need to be compiled perl. The idea, for me at least, would be to be able to use the language, not to be able use the interpreter. As in Perl, not perl. Clearly, running the interpreter on the brick would be as silly as running gcc on the brick.



  • Forth is tiny, but assembly can be even more tinier, be made even more compact, and reach a higher benchmark in execution than Forth or any other language.

    Is there a LEGO-assembler? Any geek out here want to invent one if there isn't one already?


  • by Magus311X ( 5823 ) on Sunday January 02, 2000 @03:44PM (#1414653)
    I personally use NQC becuase personally its much easier for me to deal with than the drag-and-drop interface provided with the application on the kit's CD-ROM, and IMHO I find it more flexible.

    Mark Miller has made modifications to allow each sensor input on the RCX to handle four different sensors per input (for a total of twelve sensors per RCX unit). He has also provided example code in NQC to show how to handle the situation. Here's the link: http://www.eagle-software.com/MindFest.h tm [eagle-software.com]. This is a great solution for those of you who would like to use more than 3 input devices on a single brick.

    What am I doing with mine? Currently I'm trying (honest!) to create an ATV that can map out its immediate surroundings (using proximity detection [http://www.mop.no/~simen/legoproxi.htm [www.mop.no]], and input from touch sensors) so that if it gets stuck it can quickly figure out how to leave the area. I just purchased my second set and a myriad of sensors too. Joy! =)
    --
  • Well, I wouldn't mention it, I've already been slashdotted into the ground once and that was just a quickie fu, but you asked...

    The Public 8-Ball [federated.com] is a robotic magic 8-ball driven by Lego bricks, RCX, and a radioshack motor (it's burnt up all my lego motors and they are just too expensive.) Hit it with Netscape and see your destiny in real time.

    And please, if anyone has a Java applet to display a stream of JPEG frames let me know, then IE users can see the 8 ball too.

    I may be slashdot resistant now. After a dozen or so people are queued for 8 ball shaking I start deflecting.
  • i'll emphasize again: that's what i was TOLD, i am sorry if it was wrong. Maybe they added extra legos to the set or something... geez
  • by Our Man In Redmond ( 63094 ) on Sunday January 02, 2000 @03:59PM (#1414660)
    You're not paying $100 (or $200 or whatever) for the Legos. You're paying for a really cool, really small computer that happens to come with a bunch of Lego bricks and other accessories (sensors, motors, and the like).

    I don't know just how cool it is yet, though. I got a set for my son for Christmas and he hasn't yet let me near it.
    --
  • Perl is only write-only if you don't know how to read perl.

    By the same logic, no one should use the cyrillic alphabet because I don't know it.

    I'm rather sick of hearing "perl is a write-only blah blah blah." Is my annoyance apparent yet?

    "Moderation is good, in theory."
    -Larry Wall

  • My little brother also got a MindStorms set for X-mas, and the first thing I did when I found out about it is dl'd NQC and packaged up a nice RPM for him...

    It actually seems to be very capable and easy to use. It lets you use the multitasking capabilities of the RCX in a simple fashion (although I can't find semaphores or mutexes anywhere :-P), but it has LOTS of power. Certainly more than the provided tools.

    It also has variables, as an above poster lamented about the provided programming tools. ;-)
  • by tlhIngan ( 30335 ) <slashdot.worf@net> on Sunday January 02, 2000 @04:14PM (#1414663)
    Here's a way to imitate more sensors/motors, assuming we can do it with a mindstorm (I don't have one, so this is just hypothetical).

    For less verbosity, I'll call the motor controls A, B, and C, and sensors 1, 2, and 3.

    Additionally, I'm assuming the motor outputs are tri-state (forward, off, reverse), but sensors are binary (shorted, open).

    [Method 1]

    Leave A for motor control, and multiplex it via a serial output from say, B. Leave sensors 1, 2 for direct use, and make 3 a multiplexed one. Contol the sensor multiplexor from C.

    [Method 2]

    Use A, B for motor control. Use C to control multiplexors for both motors and sensors. Again, sensor input 3 is multiplexed.

    [Method 2.1]

    Control motors by using a positive-going multiplexing scheme, and sensors by a negative going (reverse) scheme.

    [Method 3]

    Again, A is for multiplexed motor control.
    Again, 3 is for multiplexed sensor control, 1, 2 are regular sensor inputs.
    Use B as a clock, and C as data to control a shift-register, whose outputs connect A or 3 (as appropriate) to inputs.

    I'm not saying that the constraints aren't limiting, just be imaginative and try to think of something. I don't know if these ideas work or not, but they're ideas for people to try, perhaps mess around with, which can lead to more ideas. Perhaps try various constrained microcontrollers (very little RAM (from bytes to countable kbytes), low clock, constrained instruction set, low program memory count [there are processors that separate program instructions from RAM]), like Basic STAMPs, PICs, to more "expansive" processors like a HC11.

    The challenge is to make things work given a constraint (usually cost) >G. Perhaps you'll make an "MindStorm Expansion Brick" that hooks up to the RCX unit and offers a lot of sensors/motor control, at the expense of software complexity.
  • I just had a thought-- does anybody know of a way to get X10 remote functionality into the mindstorms computer? I have the free X10 kit they gave away a while back, as well as the MP3Anywhere wireless A/V transmitter. Building a robot that could control the lights might actually be useful, somehow, although I don't exactly know HOW useful yet.
    One way to do it would be to use the X10 serial port dongle which is a remote transmitter for any X10 device, and rig up a 9-pin port on the Lego brick, perhaps with its own power supply.
  • Alright you bastards, it was me. Yes, auntfloyd trolls occasionally, but only when I feel the need to share something with the world. Needless to say, the material was reworked a little to make it more on topic, but it is otherwise preserved. I won't tell you the secret, though, except that it was originally about religion (windows vs. linux is really pagans vs. xtians). The two seem so close to many of us, so I hope you'll understand.

    I wonder if Hemos has read it?

    ~~~~~~~~~
    auntfloyd
  • I got a lego mindstorms set for christmas, and haven't had as much time to experiment with it as i would have liked, but I think legOS is the coolest and most powerful environment for legos so far. It supports C or assembler, or anything else that will generate code that is compatible with the lego CPU. Best of all, it gives you 32 kilobytes, not 32 variables! I have heard that it is very cumbersome to download programs to it, but the dynamic loader in version 0.2 appears to have solved that nicely.

    I still think NQC is great for quick hacks, though :)
  • Bah. Comparing Forth and perl is like comparing Assembler with C, Forth may be tiny, but it also has a fraction of the functionality. Not to mention the fact that people writing Forth directly are .like this talking up end to liable

    I think the current processor architecture of assembler->C/Forth->Pascal/Lisp/Perl is an effective one, which suggests that mindstorms should exec an assembler variant.

    On the other hand, it is worth noting that as stated, Forth lends itself heavily to small interpretor size. Stack languages are trivial to implement, and one can always compile from another language down to the forth interpretor.

    Personally, I'd go for asm if possible, multiple registers and all that. But if that isn't an option for some reason, Forth plus a good compile-down language would be fine :)

  • I'm using librcx and a cross-compiling gcc. I'd use legOS if I could get it to work, but using librcx and standard C is pretty good.

    I haven't done anything cool yet because I don't have enough sensors. Having a second brick would be nice too. Hmm
  • by Anonymous Coward
    Well, most of the bits about wrath are from the Hebrew Bible (aka Old Testament), which are a mish-mash of political manuevering (Deuteronomy: the laws were made to swerve the Hebrews into strict monotheism and cement the political power of a sect of priests (deuteronomites)) and ancient myths (ie, Adam and Eve comes from ancient Summeria). Prior to the Bible, the Hebrews were a few assorted Yaweh cults who also believed in many other gods, but only worshipped the big Y.

    IMNSHO, it is impossible to take the Bible literally. It would take a stunning amount of ignorance in the face of all we know about it do so. If you are going to use the Bible as a religious text, maybe study it's history and much of the pre-israelite matieral behind much of it.

  • I bought my two Robotics Invention Sets from toysmart with a 30% off and free shipping net 'coupon' for a total cost of $280, not bad
    for two complete kits. Now my Partner and I can build our own machines and not have to fight over the RCX or other parts. Also, get one of the big Plano fishing tackleboxes, lots of nice little compartments for little Lego bits, and room in the bottom for your robot and the IR box.

    Pitsco has extra prats and the Robolab (LabView) software for $25, that makes 5 different environments for programming the RCX.

    Lego's RIS 1.5 graphical
    National Instruments RoboLab graphical
    NQC C to RCX firmware bytecode compiler
    PbForth to Forth bytecode firmware interpreter
    LegOS H8 RealTimeOS
    Not bad for a 'toy' , if only all consumer electronics could be programmed by the end user,
    I'd love to change the onscreen menu's on a lot of my A/V equipment... I'd go out of my way to buy 'open' electronics, manufacturer's are you listening?
  • by GoRK ( 10018 ) on Sunday January 02, 2000 @04:41PM (#1414679) Homepage Journal
    Here's a related topic to this whole Mindstorm business. I have a system that LEGO designed way way before the Mindstorms and even MIT's LEGO brick (which became the basis of the Mindstorms) called LEGO Technic TC. It consisted of a very simple 8-bit ISA card that connected to a black box with a ribbon cable. Basically it was a relay control card. The thing had 6 "output ports" that could either drive a motor forward and backward or operate a light. It also had two input ports for 1-bit touch sensors or optical sensors (or any other 1-bit sensor you could build for that matter).

    The whole system was programmed in a LOGO (Remember that one, geeks?) environment called LEGO TC LOGO. It ran under DOS. I have been unable to find any control programs for this thing except for the stupid worthless DOS based LOGO.

    Is anyone else still using this system? Is there anything for it under Linux?

    ~GoRK
  • by Anonymous Coward
    Hempel has done some nifty work with pbForth.

    I'd like to see an app for the Palm -- written using Quartus Forth for the Palm of course -- that would let you control and program the Lego brick directly from the Palm infrared port. [quartus.net]

    Neal Bridges
    Quartus Handheld Software! [quartus.net]

  • Perl is write-only because TIMTOWTDI means that oftentimes code not written by you will do things in ways that you never thought of and thus be completely incomprehensible.

    TIMTOWTDI is opposed to orthagonality. It makes it easy to learn how to do new things, but makes things harder to maintain.

    This isn't anything that can't be overcome with good comments and uniform coding style (ie: everyone in a group using the same methods), but it is a definite tendency in any language that gives you more than one way to do common tasks (this is true of C++ also).

    IMHO.
    YMMV.

    ps: my email address isn't real.

  • You're lucky that your high school computer teacher went to college. At my high school, the computers were just used to teach typing. No programming (or anything other than typing) was taught. I'm still trying to figure out if I can take the district to court over this.
  • I convinced the teacher of my brother's high school robotics class that they should use NQC instead of the default software or Robolab which they could barely afford. (Small private school.) So they did. The teacher was really glad to hear that such options exist -- she had no idea. So telling teachers about this is a concrete thing you can do to improve schools.

    --

  • I have built UML models and translated them into ANSI C, compiled with gcc (using rcx-tools) on Linux and run them on the Lego brick. [The UML modeling tool suite is BridgePoint/MC-3020 from Project Technology [projtech.com].]

    Actually, the H8 micro (inside the brick) is a pretty hot little micro. $200 is pretty cheap for an engineering prototyping system.

  • The macintosh boot mechanism-- called "open firmware"-- has a built-in Forth interpreter.

    I am of course talking out of my ass here, but i wonder if you could adapt this pbForth thing to run under Open Firmware.. and use the macintosh as a kind of replacement brain for the lego mindstorms.

    This would bring the number of things a macintosh can do without any kind of operating system to two-- the first being play Pong [machack.com].

    Meaning we're two uses ahead of all you PC users. Ha! You think you're so great, with your "linux operating system".. but without Lilo, you're NOTHING!! MWAHAHAA!!

    -mcc-baka
    i got my head but my head is unravelling
    can't keep control, can't keep track of where it's travelling
  • You're right in that robotics requires a lot more than just programming -- the things have to operate in the physical world, after all. I don't think that's a problem with Mindstorms but rather an issue with your expectations.

    That said, you're right that the lack of IO is constraining. You can use multiple RCXs linked via an infrared network, but that of course doubles your cost. It'd be nice if Lego would release an "RCX Pro", with something like eight inputs and eight outputs.

    (While I'm wishing, I'd also like to see a MiniRCX, about 1"x1"x2". It'd be supercool if that had a large number of IO ports, but I'd be happy as long as they were made to talk to each other easily -- you could fit quite a few in the space taken by a regular RCX, after all.)

    --

  • I'm getting off topic, I suppose, but Legos aren't the only platform where FORTH is available and you are not going to waste your time learning it.

    Versions, free and commercial, exist for any Unix with GCC [gnu.org], DOS, OS/2, Macintosh [taygeta.com], Windows [forth.com], the Palm Pilot [quartus.net], and dozens of microcontrollers. Did you know that FORTH is part of the Open Firmware [ieee.org] provided in the Sun and the PowerMac boot proms? (Note IEEE requires a subscription, so check out Sun's OpenFirmware [sun.com] page)

    The experience on one platform transfers well to another and there is lots to like about FORTH, especially when dealing with an environment with exceedingly limited resources in comparison to a PC.

    This list of FORTH implementations by platform [forth.org.uk] is a little dated but should point in the right direction.

  • Well, I got to thinking pretty quickly that only two motors was a bit of a problem and even three doesn't really allow you to do too much. So, I implemented a mechanical trinary counter which allows one drive motor and one touch sensor to control an arbitrary number of drive shafts: forward, reverse and no power. The higher order drive shafts change state quite slowly, but the thing is pretty neet anyway. With this one can basically do anything as long as it doesn't require quick response times.
  • by AndyL ( 89715 )
    They can only have 3 inputs and 3 outputs per brick. I suppose if you had to RCX bricks you could use the IR to link 'em together and then you'd have 6 outputs and 6 inputs. Has anyone tryed this?
  • by Xidus ( 50492 ) on Sunday January 02, 2000 @05:50PM (#1414698) Homepage
    A few days after getting my LEGO Mindstorms set, I hit upon the idea of using a joystick as an input sensor. I had an Atari 2600 in the closet with a few good controllers left, so I hacked together a method to use it with the RCX.

    Briefly, with any switch-based joystick, you can use different resistors between each direction wire and ground so that unique sensor values result which can be read by the RCX.

    When it's done, you have a 10-position switch that's very useful -- discrete values for joystick in the center, all 8 positions, and fire button pressed. (trigger RCX-mounted weaponry? Mmmm...)

    Complete info is available at http://xidus.xidus.net/joystick.html [xidus.net]

    Have fun, and let me know if you do anything interesting with this sensor, or even if you manage to build one correctly.
    -
    $ more ~/.sig
    ******** .sig: Not a text file ********
  • it was a strictly legos competiton. we had conciderd some sort of switch, but you still have to have some extra equipment for that.
  • by mattdm ( 1931 )
    On a related note -- the folks at MIT who did the original devel work for the RCX (they didn't have much input on the final product) are still using Logo -- they've got their own replacement firmware and development environment. Unfortunately, it's got a very restrictive license and isn't available to anyone outside of education.

    --

  • Okay, it's not Mindstorms related but...



    I finally solved a problem I've been working on for several years: a Technic four-speed transmission done my way. Sure, the SuperCar(the coolest Technic set ever) 8880 has it, but no reverse. Last friday I was really bored at work, so I laid out my (flawed) plan that has been sitting on graph paper for years, and finally ironed out the kinks. Now I just need to get drawing again and put the plans on my website, and look for a place on it(so the gears don't get in the way of each other) to implement reverse. It's tricky, but can be done.


    And after I finished that, I found an alternate way using universal joints to make odd, but nicely spaced gear combinations.
  • Greetings,

    I've read alot of hype about the Lego Mindstorm and while it looks fun I have found the Basic Stamp to be much more interesting. For those of you who don't know the Basic Stamp is a small microcontroller with a built in interpreter, and memory unit. The interpreter understands a version of Basic called PBasic (stands for Parallax Basic), and it's very simple to program. For those of you interested in Electronics and Embedded computing this is a great way to get started at a fraction of the cost (the stamp unit only costs around 35 bucks). I highly recommend these two books for starters:

    "Getting Started in Electronics" By Forest M. Mims III (Published by Radio Shack).

    "Programming, and Customizing the Basic Stamp Computer" By Scott Edwards.

    also Nuts and Volts magazine has a monthly column dedicated to the Basic Stamp. This is the ultimate in hacker toys =).

    www.parallaxinc.com has more info. Enjoy.

  • by Anonymous Coward
    I'll agree about the grits/portman thing. Depending on my mood my reaction vaccilates between "dammit, those idiots AGAIN" to "Jesus those guys are hillarious".


    About Money__ -- people should be punished for not bothering to read articles (ie, the "-1 Redundant" moderation for posts that ask questions answered in the article), not rewarded for exploiting the lazy.


    Also, the Whores to the Karma Whores do serve ONE purpose: we OCCASIONALLY remind moderators that the post we are mocking were either off-topic nonsense or information simply filtered from the original article. This IMPROVES the signal/noise ratio (for people who sort by score; 0-5, which I believe is most of the slashdot community) because Singal11 and Money__'s mostly useless posts won't get their knee-jerk score of 5.


    Of course, some people are probably just doing it to be assholes. I apologize for those wankers.
  • I run a small website for Lego Robot (and general robotics) fans. Check out www.marsrobot.com for many interesting examples of mindstorms fun. How many toys are there that can be hacked to the level that the mindstorms kit has been?
  • In simple math, yes it's well worth it. I usually spend between 45 and 50 for most PC games and can finish most of them in under two days. Some longer more involved games may take me 4 or 5 days but you get the idea. When I got my Mindstorms I played with them for 18 hours straight but now I'm down to 4-5 hours/day. If I were to add up all of the time I've spent with the Lego's it would cost me about $700 to get the same amount of "rec time" from games. Since I've gotten them I've worked through all of the "book models" and all of the challenges and then started making my own stuff. The two coolest was one that launched the a vehicles driver from the drivers seat when it ran into an object (moustrap not included) and a rotating mount for my web cam (got that for christmas) that rotates about 10 deg every 20 seconds. It covers about a 120 deg arc and reverses direction at each end.
  • ...I met him at the 3rd Annual Lego Get Together [utoronto.ca] in Toronto, where he gave a pbForth demo. It looks extremely powerful, but so far I haven't run up into any of NQC's limitations for my bots, so I haven't used it yet.

    If you want to (possibly) meet Ralph, and see some cool LEGO bots in a competition, *and* you'll be in the Toronto area this weekend, check out the 4th Annual Toronto Lego Robotics Event [utoronto.ca], and look at my team's entry from last year [utoronto.ca]. It's been totally redesigned, so watch out for it...

  • Congratulations. The 8448 that I got for Xmas has a 5 speed *with reverse* now if only it had a working clutch...


    They did? OH great. They just launched the Sputnik of Lego transmissions. Now I gotta catch up with a 6 speed transmission. You see, that's my dream job, to actually design new Technic sets for a living. If there was a part I needed to have made, I could of just had a custom one(like filling in the gap of technic gears they have) made and introduced into the lego part family.
  • Was that a troll? In case it wasn't: Forth is not a subset of Fortran, nor a superset. Fortran is a second-generation language. Forth was intended to be (and perhaps is) a fourth-generation language (hence its name). They have essentially no common ancestry and are completely different syntactically.
  • LegOS [www.noga.de] rocks! For anyone unaware, it's an open source replacement for the firmware, allowing easy development of programs for the RCX in C. The programer(s) that wrote it really went off on this...it has a small 7segment font, and it's even multitasking!
  • Same here. The only classes my high school offers are "Word Processing 1 & 2" Nothing like taking a class to learn how to use MS Word. Ug.
  • by tm2b ( 42473 )
    you are only given 3 power terminals to plug your engines into, you may plug in more than three engines, but then two of them must go in the same direction.


    Actually, you've got 3 bits there. With some (very) clever cam design, you can get up to 8 different locomotion modes going. Don't think about motors - think about shafts and cams.
  • Scheme (a dialect of Lisp) is a great language for Lego Mindstorm. The syntax is simple, it could be byte-code compiled easily. There are tons of implementations to start with. It's often used to teach introductory programming, and some of the best CS texts are written towards Scheme.

    "Structure and Interpretation of Computer Programs" and "Scheme and the Art of Programming" for example.

    The biggest problem would be the garbage collector, but that problem is not a huge one as incremental real time garbage collectors exist, and the interrupt handlers would all be written in something lower level anyway.

    Anyone want to take a stab at making "Mindthtorm" (lego LISP)??

  • I mean what programming language is complete without something as basic as variables?

    Languages of the `(pure) functional' class do not have variables of any kind. They are still very complete and useful work can easily be performed with them. See for example HUGS [haskell.org] although IIRC HUGS (and Haskell) is not a strict/pure functional language.

  • by Anonymous Coward
    Perhaps, but can you redefine 1900 to be 2000??? ;)

    Tom
  • One of my Fav languages...but I have not had much use for it in a long time...I wonder if I still remember how to write in it...

    ttyl
    Farrell

    ...with memories of GraForth on the APPLE ][...
  • Hi DrPsycho, 1. About PERL...you can use LegOS..this is coool, since it replaces the firmware just like PbFORTH..but...it can be used in EITHER Linux or Windows. Personally, I want to use Linux..but I havent properly installed the cross-compiler in my laptop..I have to do it. Anyway, LegOS requires PERL..although the language used is C. Just go to Yahoo and search for LegOS for a whole bunch of websites. In addition, there are some web based cross-compilers. If u want to use PERL..suggest u download the code for LegOS for linux and modify it yourself to include PERL. But the default C language environment is AMAAAAAZING!!!!!! 2. There are other environments too...like NQC (Not Quite C), but they have some limitations. I suggest that if u really want to have fun, use LEGOS. 3. I am writing this because I am interested in robotics..trust me, LEGO MINDSTORMS IS AWEEEESOME..and it is really cool for robotics..other than buying a microcontroller board and building the robot from ground up. You are going to understand the Hitachi controller anyway if u want to do some really cool stuff. I suggest that u buy the kit (or the RCX at least) and try it out....have fun....its really cool to tell a robot to go and open ur refrigerator for you!!!!
  • Yes I agree all Bad code is hard to read. However, perl is more prone to bad coding practices since it is much more loose in its syntax.
  • Here [al-williams.com] is a BasicStamp FAQ. Below is my executive summary.

    The $35 version has 256 bytes of EEPROM (program memory), 7 word registers (data memory) and 8 I/O lines that can drive a LED (barely). The $59 version has 16K of EEPROM, 16 registers and 63 bytes scratchpad RAM. In order to drive a motor, you need extra circuitry. It is programmable with, well, BASIC.

    Mindstorms RCX brick has 16K EEPROM, 32K RAM, 3 outputs that can drive Lego motors directly, 3 I/O lines that can read sensors (some of them are active sensors, so there are I/O lines rather than just input lines), a built-in IR port, an LCD, a buzzer, and a couple of buttons. (And of course a Lego-compatible case.) It costs around $100. (The complete Mindstorms kit is about $200). RCX is programmable with any number of languages, including regular C and C++.

    The Handy Board [mit.edu] has 32K RAM (upgradeable to 64K, and of course one can build a serially addressable memory too), 4 outputs that can drive DC motors, two servo outputs, 16x2 character LCD, two user-programmable buttons, one knob, piezo beeper, 7 analog and 9 digital sensor inputs, and an IR port. And, above and beyond everything, an open, documented design. It costs $200 to $300 built and tested, and is available from any number of manufacturers. PCBs are available too, cheaply. It runs Interactive C (a bytecode-interpreted C variant) and some varianto of Java.

    There is an expansion board for Handy Board too (10 analog inputs, 4 inputs for active Lego sensors, 9 digital outputs, 6 servo outputs, and general prototyping area).

    Moderate this down (-1, Obssessive)
    --

  • [Method 4]

    Multiplex everything via sensor output. (Yes, you can program the sensor port to do output). And you can still use this port for passive input I believe.

    [Method 5]

    Just add another RCX, make 'em talk via built-in IR.

    Moderate this down (-1, Silly)
    --

  • Well, as Markus Noga, author of legOS said during our "Extreme Mindstoms" panel discussion at MindFest 1999 [hempeldesigngroup.com], "Form is liberating"

    What he meant was that within the bounds of a fixed set of parts and capabilities, the challenge is to do some thing useful with the exisiting parts, not to wish for parts to build bigger things.

    Just about every LEGO enthusiast goes through a bulk acquisition mode, where the goal is to get as many parts as possible. The resulting time spent sorting severely limits building time :-)

    Check out my pbForth MazeWalker [hempeldesigngroup.com] for a bot you can build with just the parts in RIS 1.0 - well I added two rotation sensors and two micromotors, but you could also use touch sensors as shown in Mario Ferrari's TicTacToe Robot [geocities.com]

    Have fun...

  • I've got a number of comments ranging from "what a stupid idea it is to eliminate cross-platform issues by compiling right on the brick" to "what a great idea it is to eliminate cross-platform issues by compiling right on the brick" Now I don't know what to think anymore...

    Here's a real pbForth application. It's a robot that navigates mazes drawn on paper. No, it's not on wheels, it's really a gantry crane, but it's something that the standard Mindstorms firmware can't do...

    pbForth MazeWalker [hempeldesigngroup.com]

    Have fun...

  • Why couldn't they have produced a CPU unit that had some sort of bus, to which you could attach additional 'i/o units', each controling three input (sensors) and three output lines (motors)? That way, the basic unitwould not cost much more, but the expansion would be cheaper and easier... The märklin digital model train control-center implements this really good.
  • If you read my message, you'll note that I put C and Forth on the same level. However neither C nor Forth offer the functionality provided by perl, so it is an invalid comparison. Perl, as with Python, and many other languages, offer considerable built-in functionality not directly supported by systems languages. Built in regex, garbage collection, high level data structures etc. Forth, at least at its current ANS state as defined in http://www.forth.org/dpans/dpans.html, does not support the majority of the higher level features.
  • We've taken some pictures, wrote up some text and released the software we're using:

    http://fastolfe.net/features/telecam/ [fastolfe.net]
  • According to classic computer science terminology (http://www.magicnet.net/~emil/technol/compsoft.ht ml) perl is high level, forth is mid level.

So you think that money is the root of all evil. Have you ever asked what is the root of money? -- Ayn Rand

Working...