Jun 062011
 

SlateV had a feature on 3D printing and Makerbots entitled “How to Print a Bicycle”. Bre of course was the spokesman. About halfway through it though, my friend Jon saw my face. Whoop, I’m famous! Okay, so maybe not famous exactly. But they did feature one of my creations.

While I think it’s cool they used my laser-cut iPhone stand as the representative of what Thingiverse is about, they probably should have used something 3d printed instead of laser cut. :)

 Posted by at 6:39 pm
Mar 072010
 

This upcoming Tuesday, 9 March 2010, 8pm at Crash Space in Culver City, we’ll be having some fun quick DIY projects for you to build. Come on over and have fun with us. The project kits are $5 for CrashSpace members or $10 for non-members and you can take them home after you build them.

In the kit you get the parts to build your own Bristlebot, a tiny robot made from a toothbrush:
Crash Space bristlebots
(consists of toothbrush, pager motor, battery, and foam tape)

and LED throwie art:
Crash Space LED art throwies
Crash Space LED art
(consists of two color-changing RGB LEDs, battery, and a magnet)

We’ll have a Bristlebot race track you can do time trials on:
Creativity Lab  at TEDActive2010

And we’ll be showing you how to build all of this, no previous experience required. Come build bots and lights!

 Posted by at 3:45 pm
Sep 242009
 

This is one of the greatest bits of youtubery I’ve ever seen, and I generally dislike auto-tuned stuff. Carl Sagan’s Cosmos was one of the most important things to happen to me as a child. This video & song gives me the shivvers. And makes me miss Sagan all the more.

I love the song’s chorus created from cut up Sagan quotes:

A still more glorious dawn awaits
Not a sunrise, but a galaxy rise
A morning filled with 400 billion suns
The rising of the milky way

(via jwz)

 Posted by at 9:42 pm
Jul 302009
 

[I posted this to the Arduino developer's mailing list, but figured others might find it useful too]

When I first started with Arduino, I thought Serial.available() was a very loose wrapping of the RXC bit in the USCRA register, i.e. if I didn’t get data out of there fast, it’d be gone. That led to convoluted code like:

 if( Serial.available() ) {
   val1 = Serial.read();
   while( !Serial.available() );
   val2 = Serial.read();
   // and so on
 }

Yuck. So you end up designing protocols that are too terse. Or maybe you think you need to buffer so you don’t lose it:

 while( Serial.available() ) {
   commandbuffer[i++] = Serial.read();
 }

Then parsing becomes a two step process: read serial, parse buffer. Confusing to newbies perhaps, but at least it allows for a better protocol down the line. (And descend into madness as you gaze into the maw of strtok())

Because Serial contains these big comfy buffers, we often don’t need a second buffer to let us easily implement good protocols. My current favorite is to do something like this:

 // protocol is "CCaaaa", two bytes of command, four bytes of args
 if( Serial.available() >= 6 ) {  // command length is 6 bytes
   cmd0 = Serial.read();
   cmd1 = Serial.read();
   arg0 = Serial.read();
   arg1 = Serial.read();
  // ...etc...
 }

I don’t think I’ve seen any Serial examples that check for a specific number of bytes available. It’s really handy.

Implementing a human-friendly protocol like “command arg0 arg1 arg2″, where command and args are space-separated strings like “servo 12 0xff”, is currently hard with Serial. I do this right now with a 2nd buffer and lots of C hackery:

 char* cmdbuf; char c; int i;
 while( Serial.available() && c!= '\n' ) {  // buffer up a line
   c = Serial.read();
   cmdbuf[i++] = c;
 }

 int i = 0;
 while( cmdbuf[++i] != ' ' ) ; // find first space
 cmdbuf[i] = 0;          // null terminate command
 char* cmd = cmdbuf;     //
 int cmdlen = i;         // length of cmd

 int args[5], a;         // five args max, 'a' is arg counter
 char* s; char* argbuf = cmdbuf+cmdlen+1;
 while( (s = strtok(argbuf, " ")) != NULL && a < 5 ) {
   argbuf = NULL;
   args[a++] = (byte)strtol(s,NULL,0); // parse hex or decimal arg
 }
 int argcnt = a;         // number of args read

This sort of functionality would be great in a library I think. Maybe not in Serial, but a core class.

Any other protocols people like to use and the Arduino code they use to do it?

 Posted by at 8:50 pm
Mar 262009
 

Paul Bouchier has kindly spent time and updated the Java RoombaComm library. Not only did he add support for the newer 5xx series Roombas, but he fixed a lot of bugs, added new features, made things work easier under Windows, and generally cleaned up the mess of code I had created.

Check out the Changelog for a list of the changes. And try out the new version of RoombaComm!

Mar 072009
 

My friend Syuzi Pakhchyan had a nice long segment on Make:TV this week. She visited the todbot lab to have the laser cutter cut the designs for the switches in her garment. There’s a 1-second shot where the camera pans over the lab and to the cutter. For about 2 frames, you can see me. Wooho, my Hollywood career has begun.

You can see the post about this episode of Make:TV, or watch it here:

 Posted by at 3:09 pm