For my birthday I got a nice little polaroid sonar module. In the n months since, I haven't integrated it onto my bot yet, mostly because BotBert doesn't have simple things like a working bumperskirt or IR proximity detectiong yet. I did use it for a very silly halloween costume (yes, I went as a bat) but that was it.

Being bored in class can be a dangerous thing. This time I decided I would mount the sonar module on a servo on the bot (so it could spin around the vertical axis) and link it to my main machine Hesse across a serial line, then display the data like an old fashion radar screen in a java app.

Mounting the sonar transducer was pretty easy, thanks to some cheap copper plate I picked up a few months back at Boeing Surplus. Wonderful place, I highly recomend it to anyone who doesn't find this kind of thing tedious, even though it is way out in the car-dominated hinterlands where peds and cyclists are not welcome.

I had already written code to use the sonar for my halloween costume, and the servo I used here is identical in control to those powering the bot's locomotion (though it hasn't been modified to spin freely, so I still have precise angle control). This is all done through a Parallax Basic StampII, a very nifty little microcontroller. Having never used the serial capabilities of the Stamp before that part took a bit longer. Once that worked, though, the java app was easy to code. Well, it would have been if I had been satisfied with it just working, but I wasn't. Most of the race condition bugs have been sorted out now. :) Is it not nifty?

Java source:
I'm nt going to bother uploading the pbasic code used on the Stamp, unless someone asks for it. The Dedicated Stamp Development Workstation is an ancient XT laptop with a broken diskdrive, and I can get at the code by using the modem, but it is a very large pain. I started using the laptop when I found that Paralax's otherwise excelent dos based Stamp programming util crashed Win95. I never bothered to try it with dosemu under Linux (which I now use religiously), but what else am I going to use an XT laptop for?