Category Archives: Programming

Information on programming and programming topics.

Real Web on Your Cell– Browser: Yes, App Server: No

Chrome Walker has a post on some of the new phones coming out in Europe for 2008. One of the trends that seems to be emerging is the “real web.” This was kicked off by Apple with the iPhone, and its the idea that you can view the Internet on your cell phone with a reasonable interface. In other words, its formatted the same way as it would be on your computer.

In and of itself, this is a good thing for everyone: the cell phone industry (they sell more phones), the carriers (people use their data plans), web sites (more hits), and of course you (its pretty cool, after all). And, the hype seems to be true: people really are using their “Real Web” browsers.

However, like Apple tried with the iPhone, some manufacturers seem to think that providing a full AJAX web environment is an alternative to allowing people to install local applications. After all, the apps already exist, and they are standardized. What’s not to like?

Unfortunately, there are a couple of holes in that logic. They are significant, although even the iPhone tried to get around them and found that it couldn’t.

First, the performance of a web-based program is significantly slower than a native one. For the iPhone, for example (the only phone so far with a full web browser), a web-based AJAX game is known to be around 100x slower than a comparable native version of the same program. That’s really slow. So slow, in fact, that almost any sort of game is pretty much out of the question.

Second, web-apps are only available where there is web access. In the States, at least, cell-based web access is pretty horrific, despite whatever recent claims the cell carriers have made. And because broadband speeds are accelerating, it makes the cell rates seem that much worse. Definitely not good enough to be taken seriously for an application. Second, you can’t run the app where you get no (or bad) cell service. Like in a subway, for example. Because the phones don’t cache the web page for very long, it means that you can’t even web apps that don’t need to contact the server are unusable if you want to pull up a game like Space Wormy.

For these reasons, phones will still need local apps for at least the foreseeable future. Hopefully, this won’t lead to the introduction of new cell phone platforms and API’s. The last thing the heavily fragmented cell phone industry needs is yet another platform. However, manufacturers can’t seem to help themselves. But that’s a whole other topic.

New iPhone Game: Tetroku

I’m pleased to announce that I’ve released a second iPhone game. This one is a cross between Tetris and Soduku, called “Tetroku!”

If you like either of those games, there are elements here for you to get addicted to. The full version is available from, but the demo version is available here for free on the iPhone, and is also playable in Firefox (sorry IE users).

You can also check out my previous iPhone game, Space Wormy, also known as Canyon Crawler.

As always, feedback is welcome!

Space Wormy for iPhone

Here you go … the first action game for the iPhone. While there are a handful of board and puzzle games available, this is the first action game ever released for the iPhone!

Check it out! Unfortunately, this game only works on Safari (Windows or Mac), and on the iPhone itself. No Firefox or IE :(

** Update — now works in Firefox! **
** Update2 — Added high scores to Space Wormy! **

iPhone People Finder

I wrote a white pages application for the iPhone, and have it hosted on this site. If you’re viewing this from your iPhone, just click here, or point your browser to

For now, this app can find people’s names and addresses from their land line phone number. I’ll be enhancing it over the next few weeks (when I get back from vacation) with other ways of searching as well.

PS: The app doesn’t search your addressbook … it searches the White Pages on the Internet!

Lamby Robot Upgrade Part 1: The Plan

So, last October I build a Robotic Lamb. With the help of motion sensors, a servo and a Basic Stamp, this ordinary stuffed animal was able to creep out amuse guests (and my wife) by turning it’s head to watch them as they move around the room. Since then, it has been given a name, Lamby, and has both amused and frightened many visitors.

Yet, lately, I’ve been feeling that it just isn’t enough to have a subtle, animatronic children’s toy following you wistfully with it’s eyes. Yes, it’s time for Lamby to get an upgrade!

Since I received such a great response from my last post on Lamby, I will be putting up articles as I work on this project, with pictures of Lamby under construction, descriptions of the parts I’m using, and the code to any software I write. My goal is for there to be enough information here that anyone with only an amateur background in programing and/or electronics will be able to build the sane thing. For anyone curious, by the way, I have a good background in programing, but only a very basic background in electronics. In fact, I just finished reading “Electronics for Dummys,” which I recommend as a good place to get started.

In this part, I will outline some of the problems I ran into with Lamby so far, and my plans for his upgrade.

Fabric and Motion Sensor Mounting

Lamby was not born to be a robot. In fact, he was originally just a normal stuffed animal you might find in the store. In order to robotify Lamby, I had to cut off his head and also cut out his eye sockets. This allowed me to place PIR motion sensors in his eyes, and then mount his head on a servo motor to allow it to spin. This generally worked fine, but lead to problems, which I’ll be addressing in the upgrade:

Once the fabric was cut, it tended to keep tearing on its own. This led to Lamby’s gradual disintegration, which I halted with scotch tape. Definitely not an optimal solution. While the most obvious solution is to sew the parts of Lamby that were weakened by the scissors, there are 2 reasons why this might not be the best idea: First, it assumes you know how to sew. Second, I would like to more permanently attach the PIR sensors in his eye sockets (they tended to move around a bit), and you can’t sew plastic. Instead, I think a better solution will be crazy glue. I plan on crazy gluing the PIR sensors in Lamby’s eye sockets, and also crazy cluing any loose joints or weak spots in his fabric.

Servo Mounting

Lamby currently has a single servo. This is mounted in his neck, and allows his head to turn. The servo’s gear is embedded in the stuffing in Lamby’s head, while the servo itself is mounted in the stuffing in his torso. This allowed the head to turn. However, stuffing is soft stuff, and sometimes the servo would turn, but the head would not, or not turn as much. Obviously, it is not a good idea to anchor a servo motor to stuffing :). Instead, Lamby 2.0 will have a plastic skeleton, which I will use to attach his internal components.

Embed the Controller Circuit

While Lamby himself was fairly subtle, the fact that he had wires coming out his neck attached to a circuit board was enough to tip off most people that something was not quite right. Lamby has a fairly large torso … in Lamby 2.0, the circuit board will be placed inside his body. It will be inside an anti-static bag to prevent the stuffing from shorting out the circuit, or causing a fire.

More Motion

So far, these have been improvements in Lamby’s construction, but there haven’t been any new features. So, there is poor Lamby, and all he can do is watch people as they go by, not being able to participate. I can’t have that! Lamby 2.0 will receive 2 additional servo’s: He will be able to wave each of his arms independently.


The microcontroller inside of Lamby is fairly limited. Until now, Lamby’s only job in life was to look at things moving. However, with his new capabilities, He will have to do more than that. Unfortunately, his microcontroller brain will not be up to the task. Instead, I will fit Lamby with a USB port uplink to a computer. Autonomous functions, such as watching motion, or waving when someone enters the room will be performed by his microcontroller. More complex thinking, however, will be done on the computer. The computer will then send instructions to the microcontroller to tell Lamby how to move and act.


You’re probably wondering what sort of actions are so complicated when Lamby only has 3 servos and 2 sensors? Well, thanks to the advances of cheap USB sound cards, Lamby will also have a speaker and microphone embedded in his chest. This will be connected via a USB sound card (less than $10!) back to the computer as well.

The software running on the computer will include basic voice recognition and voice synthesis. This means, that you will be able to walk up and say “Hi Lamby,” and Lamby will reply back “hello” while waving. This is where the processesing power of the computer comes in.


This one I’m not entirely sure about yet. I think that I might install an X10 controller on the computer Lamby is connected to, and then connect some of the lights in my apartment to X10 plugs. This would allow Lamby to turn lights on and off in my apartment, potentially on voice command, when he sees motion, or when he wants to mess with you.

Computer Software

I plan on developing two pieces of software for the computer, as interfaces with Lamby:

Voice Interface

The first is going to be a voice interface. I’ve found that one of the main problems with voice recognition interfaces is that you have to know what commands you can say, and what will be recognized by the computer/robot. Since you are interfacing with a robot though, and not a computer, I can use the whole computer screen to show what Lamby is thinking. The first program will blank out the whole computer screen. On the top half of the screen will be a voice modulator bar, which will just be some eye candy showing Lamby’s voice output. You know, the horizontal line that deforms based on the sound coming out the speaker? The bottom half of the screen will be a list of words or phrases. These are the current list of phrases that Lamby is listening for. For example, if you say “Lamby,” the list of words might display “what is the weather, what time is it, look to the left.” If you say “what is the weather,” the list will change to be “now, later, tomorrow, this week.” My goal is that this will be intuitive to people who have never seen it before — ie, visitors in my house.

Direct Control

The second application will be mainly for development. This will be a direct control program. Basically, when you run it, your mouse (or XBox controller) will take direct control of Lamby’s arms and head. Also, it will record your motions, so that they can be played back later. I’ll be able to use this program to do 2 things. First, I can use it to control Lamby like a puppet. Second, I’ll be able to record complex motions for Lamby which he can play back on his own. This will make things like waving, shaking his head, etc much more natural looking than just a simple programatic command.


Here are some sample use-case behaviors I expect Lamby to be capable of when his upgrade is complete:

  • When someone walks into the room, or moves after staying still for a while (watching tv?), Lamby will wave or say hello .
  • When someone moves around the room, Lamby will look at them.
  • You will be able to ask Lamby the time, weather, or stock ticker price, and he will answer in voice
  • Lamby may make random “intelligent” comments, like “Wow, its dark out already,” or “It’s unseasonably cold out today,” or “Hey, aren’t you supposed to be at work?!” most of this information he can get off the internet, courtesy of controller software running on the computer.
  • With X10, you can tell Lamby to turn the lights off, and he will.
  • You can tell Lamby to wake you up “in 10 minutes” or “at 8:00,” and he will by turning on the lights, and yelling at you until you tell him to stop.

End Result: Lamby 2.0
So, the plan is that after the upgrades, Lamby 2.0 will become not just an animatronic toy, but basically an avatar. With the addition of speech and voice recognition, it will appear to be intelligent. Since I can use it as a front-end to web-enabled scripts, Lamby will appear to have real-world intelligence. He will know if its raining, if you’re home from work early, and if it’s rather warm for this time of year.

Oh yeah … he’ll also be able to watch you as you walk around the room. :)