I mentioned a few weeks ago that Stephen Wolfram (Mathematica genius) and his 13-year-old son Christopher presented after us at Maker Faire NYC this year, and Christopher did a very impressive AR.Drone demo (with even more impressive on-stage debugging). Now Stephen hasposted with more info about that:
Christopher has been an avid Mathematica user for years now. And he likes hooking Mathematica up to interesting devices—with two recent favorites being Arduino boards and quadricopter drones.
And so it was that last Sunday I walked onto a stage with him in front of a standing-room-only crowd of a little over 300 people, carrying a quadricopter. (I wasn’t trusted with the Arduino board.)
Christopher had told me that I shouldn’t talk too long—and that then I should hand over to him. He’d been working on his demo the night before, and earlier that morning. I suggested he should practice what he was going to say, but he’d have none of that. Instead, up to the last minute, he spent his time cleaning up code for the demo.
I must have given thousands of talks in my life, but the whole situation made me quite nervous. Would the Arduino board work? Would the quadricopter fly? What would Christopher do if it didn’t?
I don’t think my talk was particularly good. But then Christopher bounced onto the stage, and soon was typing raw Mathematica code in front of everyone—with me now safely off on the side (where I snapped this picture):
His demo was pretty neat. He had a potentiometer hooked up on the Arduino board. And he’d set it up so that all he had to do was type a command intoMathematica to get its value:
Then it was Dynamic[ArduinoAnalogRead], and Mathematica is dynamically displaying the value in real time as he adjusted the potentiometer.
Then he makes it into a gauge (er, that’s actually from a future version ofMathematica, but Christopher is a keen user of internal development builds):
And then he says he’s going to make a dynamic plot of it. And pretty soon he’s typing the Mathematica program, confidently presses Shift-Return—and it actually works:
Then he’s on to using an ultrasound sensor, and having it produce musical notes based on distance.
And then he’s on to the quadricopter. He’d been going back and forth with someone at our company for a few days before, trying to get the kinks out of the interaction with the quadricopter‘s API. I had seen the quadricopter fly that morning, but I knew Christopher had changed the code quite a bit since then.
His plan was to have a single line of Mathematica code that would make the quadricopter fly a specified 3D path. He had a list of points for a square, entered the line of code, and pressed Shift-Return, and… nothing happened!
I guess Christopher has debugged quite a lot of code in his 13 years. And now he set about doing it in front of the audience. A missing function definition. A missing command to connect to the device. He was finding quite a few things. And I was getting ready to call out that he should just give up.
But then… the sound of quadricopter blades, and up the quadricopter goes… flying its loop on the stage, and landing.
It had actually worked! It was pretty neat, being able to just type one line of code into Mathematica, and then having some physical object fly around in the pattern one had specified:
After another flight, the audience had questions. One person asked if the quadricopter could respond to its environment. Which set Christopher off on some more “spectator programming”. And actually, it took him only a line of code to get the real-time video from the flying quadricopter, and feed it through simple Mathematica image processing:
I was pretty impressed that all this worked (here is the full video). And, yes, Christopher was clearly right that his topics were very relevant to Maker Faire. In fact, it seemed like Arduino and quadricopters were two of the three main technical themes of the show. The third was 3D printing.