http://qs321.pair.com?node_id=424812


in reply to Perl and Robots

Oh Perlmonks, oh man oh man oh man, the replies in this thread, the replies in this thread. I can't believe it.

Anyways, as far as introductory microchips go, the parallax basic stamp is actually pretty nice. The problem, is, of course, the whopping 32 bytes of ram coupled with the (unusually fast) 2k of eeprom. You're barely going to have enough space to hold your program, much less do anything complicated.

You might be better off using a PIC, which is like super-cheap mini microcontroller. (try http://www.microchip.com/, you should be able to search around and find them for 5-8 bucks a pop). In addition to being cheap, PICS will be much faster than the stamp and have somewhere in the range of 16x - 64x the memory, as well as more I/O ports.

Unforunately, you'd need 20x more memory on top of that (at least 2 megs) to embed even the most stripped down versions of perl, such as miniperl. One technique to get around this is to write a domain-specific high level language and compile it (using Perl and Parse::Recdescent) down to whatever assembly language that the PIC uses. Not only will this make your code reliable and consistant, it can also give you the chance to write a simulation layer that will make your testing phase much faster.

I've been successful with this approach in the past, and am currently using the same approach in an AI-heavy robotic art project that I'm involved with right now. I highly recommend that you give it a shot. :)