Monday, August 31, 2009

Introducing the ButtonPad

Update: A lot of people have been picking up the ButtonPad-Mega-Slide-Backpack combo, so I've put it up on the shop as the Portable MegaPalm Pack here.

The ButtonPad is a shield for the Arduino Mega. It is specifically designed to turn the Arduino Mega into a portable gadget, when combined with a TouchShield Slide.



You know that scene at the end of Star Wars, where the spirits of Obi Wan, Anakin Skywalker, and Yoda appear altogether to Luke? In case you forgot, it's this one... it's when the eerie theme music plays and you realize Luke has all along just been part of the bigger plan... dun dun dun...

The ButtonShield is like Anakin... tons of power, features, and more midichlorians - er buttons - than you know what to do with. The InputShield is like Obi Wan. The X-Y force is strong with him, but more in an analog sense if you know what I mean. That leaves only one. What follows is my tripartite inductive logic proof:

Assume this:


Corollary: let Anakin=ButtonShield, Obi Wan=InputShield:

Therefore:

Small in stature he may be, but powerful his API is.

The ButtonPad is like the Yoda of Arduino Shields, and the Arduino gadget platform.

This now completes the ButtonShield, InputShield, and ButtonPad Trilogy... Chris and I were thinking about how we could make a shield for the Slide that would make it a gaming platform, but we couldn't figure out why the Arduino guys decided to make the form-factor the way they did... for instance, I really wanted to put the ButtonShield on the Arduino Mega at the same time as the TouchShield Slide, but you can't... it just doesn't fit.



...but instead of getting upset, he and I decided to just think a little differently about the size and layout constraints, and instead make a "mini-shield" ala a "pad".

This is a set of pictures of me mounting the ButtonPad onto the Arduino Mega with a TouchShield Slide:



It fits directly onto the bottom part of the Arduino Mega, and there's a library built into the Antipasto Arduino IDE that allows anyone to interface to the ButtonPad to read characters. Here's some code that let's anyone read it:


#include ButtonPad.h

//Create a new ButtonPad
ButtonPad MyPad = ButtonPad();

void setup()
{
Serial.begin(9600);
}

void loop()
{
//Display the pressed buttons to the PC
Serial.println(MyPad.readButtons());

delay(250);

//Random LED blinkage
MyPad.ledWrite(random(0,6),HIGH);
MyPad.ledWrite(random(0,6),LOW);
}


And here are some more pictures of the Arduino Mega gadget:



I've uploaded some more pictures over on my Flickr page, and also Justin put it up for sale on the shop over here.

Sunday, August 30, 2009

Up and running on the ButtonShield (and the ButtonPad)

The ButtonShield has been on the Shop for a while now, and Justin and Mike have sold a lot more of them than anyone ever thought, so Justin figured he would email around (with permission of course, not spam!) and ask what projects guys (and gals) were doing with them. The funny thing is that quite a few people actually worked at companies doing electronic design full time. Some guys said they were using the ButtonShield to create mockups of devices for presenting to management in order to get real project funding to build a project or a new device. Apparently the process of doing this also has official names, like "rapid prototyping" and "concept mockups". I always thought of rapid prototyping as 3D printing your own hardware, but apparently you can't 3D print working electronics (yet...almost), so for that, that's where Arduino comes in.

At least now I know what people are doing with their ButtonShields, which is gratifying because most of the time if you build something for someone else, you never get to hear what they did with it. Anyway, I figured it's high time to do another "up and running" post, so this is "Up and Running with the ButtonShield".

Step 1: Get the IDE

The Antipasto Arduino branch of the Arduino IDE has the ButtonShield hardware libraries baked in, and it's available for Mac, Windows, and Linux over at the "App Store".

Here's the Windows version

Here's the Mac version

Here's the Linux version (although technically if you're using Linux, this link is redundant because you probably already checked gitub. Actually you probably already know everything in this blog post because you committed source code to the tree... thanks electricFeel and mediaCoder)



Step 2: Install the IDE

Launch the installer (after Firefox checks to make sure there aren't any viruses or spamware, which there aren't but just in case). And just save to the default location (please) because the installer's technically not that smart, and likes to just be saved to the default specified place (neither Chris nor I are experts at writing installers).

Then wait 1-mississippi 2 mississippi 3 mississippi ... n^k m (iss)^2 ippi... done.


Step 3: Launch the Antipasto Arduino IDE

(For Windows users, the Antipasto Arduino IDE installs into the main Start menu.) When the IDE launches, it show a tab that's sticking out on the left. That's the "Gadget Module" selector tab, which allows me to pick which modules I'm writing code for.


Step 4: Create a New Gadget

Go to File->New Gadget to create a new "Gadget file". A Gadget file is a meta-file format that Omar developed that allows anyone to store multiple source code files compiled for different module architectures. That way, a single Gadget file can contain source code for a TouchShield, Arduino, ButtonShield, etc.

You can name the gadget file anything you want, I usually just call it "test" or "default" or "hello", but there are definitely more creative names out there.



Step 5: Add the Arduino you have by clicking the Plus Sign in the Gadget Window

Like this:



This sets all the source code you need in order to program the Arduino. It also pops up a standard template program including loop() and setup().


Step 6: Copy and paste the Hello World ButtonShield Code

Copy and paste this code into the Antipasto Arduino IDE window, replacing and overwriting anything that was already there:


#include

/* Setup for Mode A */
ButtonShield buttons = ButtonShield(0);

void setup() {

Serial.begin(9600);

}

void loop() {

Serial.println(buttons.readButtons());
}


This code includes the ButtonShield header which includes all the communication primitives you need. Then it defines a variable, ButtonShield buttons, so that you can use the variable buttons anywhere else in the code. Of course Serial.begin sets up a serial communication between the Arduino and the computer. And the piece-de-resistance (haw haw hawww in French) is: Serial.println(buttons.readButtons()). Really that's just trying to be clever on one line. First it's calling:

buttons.readButtons()

which is the magic function. It will read whatever is being pressed on the ButtonShield keyboard at the current time. Then, it encases it in:

Serial.println()

which is the function that sends the number back up to the computer to be displayed.



Step 7: Compile the Code

Press the run button, to compile the code. If anything goes wrong, just make sure that the code is exactly right. If it is, but it still isn't working, email me :)


Step 8: Put the ButtonShield on the Arduino

This is the ButtonShield and Arduino separated:


Action shot - slow-mo cut sequence:

This is the ButtonShield and Arduino, happily reunited:


Step 9: Connect the USB cable from the Arduino to the computer

This is so obvious I'm not putting a picture here, on principle.



Step 10: Set the USB port in the Tools->Serial Port menu

If you're like me, you regularly have 4 or 5 Arduinos (and these days, 10-15 Illuminato X Machina's) dangling off of various USB ports around your computer. So then I always have to try to guess which USB Com port the Arduino decided to become this time - it usually works on the second or third try. Or maybe you just have one Arduino plugging in at any given time, and it's a lot easier.




Step 11: Upload the Program to the Arduino

By pressing the Upload to I/O Board button. Wait until it's done uploading (by checking to make sure the LED's have stopped blinking like mad underneath the ButtonShield).


Step 12: Open the Serial Monitor

And press buttons on the ButtonPad, and the key codes will be displayed in the Serial Terminal window...



Step 13: Use this code if you have a ButtonPad

13 is a lucky number because this is code for the ButtonPad, which hasn't been blogged about yet... and isn't even up on the store yet as of this post, but yeah... if you have a ButtonPad, which as of right now is no one but me and Chris, you could use this code:


#include

//Create a new ButtonPad
ButtonPad MyPad = ButtonPad();

void setup()
{
Serial.begin(9600);
}

void loop()
{
//Display the pressed buttons to the PC
Serial.println(MyPad.readButtons());

delay(250);

//Random LED blinkage
MyPad.ledWrite(random(0,6),HIGH);
MyPad.ledWrite(random(0,6),LOW);
}


Thursday, August 27, 2009

Disco Touchshield

Giggawatt jut posted a really cool app that utilizes trig based math functions. All lengths are calculated using trig based on the shape of an ellipse. With each touch on the touchshield, a random color is assigned to the discostar.

"Remember those crazy star shaped clocks from the 70's? Well, that was the inspiration for this." - giggawatt

The app is called discostar and it is a great example of using math functions on the Touchshield Slide



Wednesday, August 26, 2009

Illuminato X Machina In Action

I got a few emails about seeing the Illuminato X Machina in action, so here are the first two videos I took.

Last week, I took a few videos of Dave and Chris programming and running an array of Illuminato X Machina cells. In the first one, there are only two cells. As soon as Dave attaches the second cell to the first, it automatically boots up, downloads the code, and begins to execute the same program.



The idea is the same, but when there's two arrays that are each pre-programmed, the most updated code will "infect" the rest of the grid until they're all synched up. In this case, the cells are set up to accept compare code against what their neighbors are running, and download it if their neighbor's code is newer.



With blinking lights (my language of choice :-) the Illuminato X Machina code sharing scheme shows robustness in action. Even if one of the cells stops working, the others can carry on. And if the cell comes back online or is replaced, it will autonomously boot up and check with its neighbors to pick up the latest program...and continue running.

The code for these two demos will be up on www.illuminatolabs.com soon, and I'll be posting a couple more videos as soon as I get them uploaded. In the meantime, feel free to email me at jhuynh at gmail if there's a cool project I should try with a tribe of IXMs...

Monday, August 24, 2009

Cross platform, Open Source IDE, Resources, References, Schematics

It's funny how about 5 months of work can be summarized into a simple little blog post this small. Basically Chris, Dave, Omar, Mike, Justin, and I put everything together below over a ridiculous amount sleepless nights.

I got a very skeptical email a couple days ago asking me, "why Open Source hardware?" The links below should make it obvious... hardware is meant to be open. Open Source makes hardware more fun, because you can hack it without $1000's of dollars of oscilloscopes... you can hack it just by digging through code API's and schematic diagrams. You can push it to its limits, and make it do what it was never meant to do. Everything ever built and sold at the Liquidware shop has easter eggs in it, and ... the Illuminato X Machina is filled with Easter eggs.

:-)



The rest of this blog is going to be a very repetetive, because everything is now uploaded up at the same place, over at "Illuminato Labs," which is the "holding place" if you will, for all of the Illuminato X Machina files. That includes:

-The customized version of the Arduino IDE, called the Antipasto Arduino IDE, specifically designed to program the Illuminato X Machina - of course there's a Mac, Windows, and Linux version

-The Open Source code repository, hosted on github, linked here

-Documentation and references

-The Core functional API

-Schematics



-Gerbers

It's all Open Source, released under the Creative Commons license...

Thursday, August 20, 2009

Physical Computing Meets Modular Robust Computing

I think I first heard the term physical computing when I met Tom in NYC, and talked to him about his research interests. There's something very simple and practical about the idea: the more you can touch it and play with it, and manipulate it with your hands, physically, in front of you, the more intuitive it is to understand. Physical computing is all about learning electronics and engineering with your hands. That's what the Arduino was initially all about, for simple circuits and basic components. What makes physical computing fun is that things become easy to pick up and learn, guys with no previous engineering experience can pick it up and actually get it and start to use it.

Now that physical computing is becoming more widely appreciated, Dave thought it made sense to try to apply physical computing to another topic, albeit slightly higher in the learning curve in comp sci and computer engineering:

-Parallelism,
-Interconnectivity,
-Robustness and
-Modularity

These are like the four horsemen of the computer architecture apocalypse for computer scientist majors learning advanced engineering topics... they're coming to get us all, one of these days. Probably sooner than later. Everyone's coming out with parallel processors, but the only tool out there to learn about parallelism and parallel processing is big, heady, theory books whose average word size is 22 letters long, and all the citation references are at the end of the book, reminding you of why hyperlinks were invented in the first place. But yeah, I hate having to read big words when I try to learn on my own. I like little words. I will not eat green eggs and ham:

I do not like the clockspeed wall,
It will not run my code at all.
The speed of light, it will not fall,
All my clock pulse are belong to EOL,
Bringing register sync down to a crawl.


Ehhhh... Ok not that bad, but you get the idea... actually that sounded a bit more like some weird chant than a Dr. Seuss poem.

In the Slashdot article, one comment mad me laugh, even though it wasn't highly karmad. It pretty much sums up a lot about the physical computing nature of the Illuminato X Machina, even though the comment I think was meant to be a joke. Dave has actually written code to do exactly this, and it's baked into the default API on the Illuminato X Machina. The only part that's different is at the end...

...Begin quote...
Anonymous Coward
Independent decision making modules Cell# 3712: Hey guys, have you noticed that #1914 never seems to accept requests?
Cell# 141: Well, he does sometimes reject.
Cell# 4439: I don't route to him very much anyway.
Cell# 1142: He rejected the last three of mine. I kind of agree.
Cell# 3712: So what should we do about it?
Cell# 141: Can't we just fry him? There's plenty of us anyway.
Cell# 3712: That's a bit harsh.
Cell# 4439: Ok, I got the records here showing that he rejected 90% of requests the last week but allocated two hundred percent of average power to himself.
Cell# 3712: That motherfucker, let's do it then.
Cell# 1142: I don't really want to fry him, but I don't mind that much if you do.
Cell# 141: Ok, gather up all your spare power, STAT!
...End quote...

EDIT: Cell# 141 ought to be saying: Ok, I've tallied the votes and we all agree. Let's power this guy down starting with me disconnecting him, lest his fault is indicative of a failure that could become systemic, maybe because he shorted out. Or maybe the Deus Operator unplugged him. Don't know don't care he's broken.

I suppose you could also have an Annoying Devil's Advocate cell say, "just playing devil's advocate here, but shouldn't we all try to send Cell #1914 a packet just to see maybe he's sleeping". Or a Flamebait Cell say, "Wait is this really the most efficient way to handle the situation, you overzealous socialist cells. I've decided randomly to keep trusting him for the next 5 messages I send then he gets the can." Or Middle Management cell, "Wait, I understand what you're saying but we should really ask our boss before we make any decisions right now... I'm not comfortable committing to this right now." I spend too much time in meetings.

At least the Illuminato X Machina is getting people to talk about modular robust parallelism in new, normal-person-speak, which I think is needed as parallelism increasingly grows mainstream... the goal is to make experimentation with robust modular parallel computation accessible.


Wow, thanks!

By the way, I also wrote some more at the Arduino forum here with a couple more pictures.

Wow... Wired and Slashdot. The last 6 hours have been kind of funny and exciting and educational. I have a lot of emails in my inbox, and I'm going to reply to every one of them because there are a lot of insanely cool ideas, and I'm going to try to summarize them all up and share them over the next few weeks... while I work on my projects using the Illuminato X Machina boards (pronounced ill-oo-min-ah-toe ex mah-kee-na).


The really humbling part about when someone else writes something about a project you're working on is realizing just how much you suck at writing... but you only realize that when you see how someone could summarize your entire series of blog posts with a ridiculously more concise version:
"An ambitious group of hardware hackers have taken the fundamental building blocks of computing and turned them inside out in an attempt to make PCs significantly more efficient. The group has created a motherboard prototype that uses separate modules, each of which has its own processor, memory and storage. Each square cell in this design serves as a mini-motherboard and network node; the cells can allocate power and decide to accept or reject incoming transmissions and programs independently. Together, they form a networked cluster with significantly greater power than the individual modules."

Well, hmmm yes... that's exactly it... thanks, Priya :-) And then someone apparently passed another version to Slashdot:
"A group of hardware hackers have created a motherboard prototype that uses separate modules, each of which has its own processor, memory and storage. Each square cell in this design serves as a mini-motherboard and network node; the cells can allocate power and decide to accept or reject incoming transmissions and programs independently. Together, they form a networked cluster with significantly greater power than the individual modules.The design, called the Illuminato X Machina, is vastly different from the separate processor,memory and storage components that govern computers today."
Which is also a much better version than my explanation of the Illuminato X Machina. Ok, so I think I'm going to stay hacking hardware instead of writing professionally. Thanks Anonymous Slashdot reader :-)

While I'm on the topic of thanks,
David Ackley (from UNM who I met at the Santa Fe), Chris, Omar, Mike, Justin and I also wanted to thank:
I'm very excited... in a pop-some-more-penguin-mints kind of way (I have a lot of empty tins if you're interested). This is what Open Source Hardware was meant to be like I think, but in this case the last 6 hours have felt like a lot of "open source ideas", with tons of communities all over the place talking about what ideas they have. So now I know what I'm going to do. I have spent the last few hours collecting hundreds of questions, and ideas, and emails, twitterthings (a little part of me dies inside everytime I say tweet), and chat blurbs and I will do what Open Source was meant to do: incorporate them back into the projects and code I am working on with the Illuminato X Machina and the Santa Fe Project.

In the meantime, I set up a dedicated site where I'm going to keep all the information like docs and schematics and gerbers and IDE compiler code and samples over the next few months... a lot of people are asking about them but they're not done... lots of documentation to write, and files to convert and zip up, but it should all be up by the end of the weekend.


Wednesday, August 19, 2009

Introducing the Illuminato X Machina

The Santa Fe Project is a crazy one, and over 6 months ago, David Ackley and I originally talked down at the Santa Fe Institute about what we would need as far as tools were concerned in the software and hardware domain in order to really get a “feel” for what we were about to try to solve. We sketched a few ideas on the back of scrap pieces of paper (we didn’t have any napkins lying around), and came up with a list of humble and meager features we’d want in a hardware platform: infinite scalability, ad hoc interconnectivity, dynamic boot load and code flashing, physical manifestation of software code, physical computing, compatible with Open Source language work in physical computing like the Arduino platform, a very fast core processor, a more powerful chip than an 8 bit Atmel, yet an approachable basic set of functionality that would allow us to expand on it easily, and a large community of heavy duty, hardcore software and hardware hackers.

Simple! Errrrr…

Then I jumped on a plane and headed back to New York and rode my motorcycle as quickly as I could to Connecticut, and met with Chris and Mike, and said, there’s got to be a way to build this thing… right? Mike laughed at me, but Chris said bring it on.

(6 months later)

And so, it’s with that same kind of pride that you get when you fix a bug and a 1000 line program compiles on the very next try that I proudly introduce the Illuminato X Machina.

The Illuminato X Machina is the result of an Open Source collaboration between David Ackley from the University of New Mexico, Liquidware, and Illuminato Labs. It’s what you’d expect if Complex Adaptive Systems met Open Source Hardware at a bar, drank too much and had a love child that was raised on Physical Computing child support in the suburbs of Modular Electronics. Then one day that child spontaneously cloned itself hundreds of times, and decided to hold hands with all of its clone siblings so that it could play a crazy N^2 O*log(O) game of telephone. Or something like that.

It’s a small “motherboard cell” that can interchangeably link and connect up to other cells, either rightside up or upside down, to adaptively route packets and power to its neighbors, like a grid of biologic cells, passing nutrients and resources to their neighbors. Also, each board can program its neighbors using a dynamic bucket-passing bootloader that allows any given cell in the grid to over-ride or re-program neighbors.

Each cell runs a 72 MHz ARM processor with 56 digital I/O pins, and the ability to accept power from any one of its 4 edges. This means that the cellular grid can expand in any direction, and the reversible interconnections mean it can grow like a crystal in any orientation. I've uploaded more pictures to my page on Flickr too.

The Illuminato X Machina boards will be available in a limited quantity run that's ready 2 months, so I've put them up for pre-order here. Basically, it is like the Borg of open source, DIY physical computing… it’s crazy, and 7 guys and gals will be hacking it like mad over the next couple of months :-)

Friday, August 14, 2009

Dave's Course

It sucks that I have a day job. If I didn’t, I’d be flying to the University of New Mexico every week to work with David and his class. His class is going to address a lot of the topics I’ve been talking about, the future of computing, and robust physical computing. That has a certain ring that’s starting to grow on me…

If you want to be added to the little informal mailing list of guys hacking over the next few months, or if you’d like to meet up in Boston or head over to the University of New Mexico and meet up, just send me an email at inthebitz at gmail.

Thursday, August 13, 2009

That's My Slide!

I was watching my nephew yesterday and to keep him occupied, I gave him my Slide to program... he quickly got distracted by the paint program and wouldn't let me do any programming on it...


Next time I'm going to give it to him without the paint app loaded...

Wednesday, August 12, 2009

The Santa Fe Project, and the University of New Mexico

What happens if Moore’s Law isn’t the only thing that matters? Are Harvard and Princeton architectures the only choices, especially as the world moves increasingly to parallel architectures? Whatever happened to the plethora of alternative architecture that thrived during the 1970’s and 1980’s? If Seymour Cray were alive today, what would he have developed? What is the Linux equivalent for computer architecture?

The “Santa Fe Project” is about challenging everything I learned in undergrad class, and everything that is taught in computer science books. As a matter of fact, there are a fair number of old, rusty, mildew-collecting books at the Santa Fe Institute in New Mexico that do nothing but talk about computer architectures. But they’re all the same, the only thing that ever changes are the number of registers, the bit width of the registers, and the amount of memory available to you.

There are some people that argue that because every computing machine is Turing Complete, it doesn’t make any sense to build anything else, you can “just emulate it all in software”. But that’s an awfully narrow-minded and usually impractically academic mentality. The problem is that software is intangible, it’s electronic. It’s not physical, so it doesn’t occupy meaningful physical space. It doesn’t interact directly with its environment, it doesn’t change its surroundings, and it doesn’t interact with users physically.

What would a computer look like if it was a complex adaptive system that existed in real, 3 dimensional physical space?

Over the next 2 months, Chris, Mike, Omar, Justin, Matt, and Dave Ackley are going to try to challenge everything we know, by intentionally “undoing” computation. The Santa Fe Project will be as much a mental challenge as it will be about physical hardware design and software design.

And while all of this is happening, Dave Ackley is going to host a course at the University of New Mexico, in the computer science lab. Everything we build and develop, and test, and explore, we will launch immediately to the University of New Mexico and at the Santa Fe Institute. In fact, he’s been working on a syllabus, and we’ll talk all about the research and projects here on the blog.

Monday, August 10, 2009

Run in with the Santa Fe Institute

Over a year ago, I was working in finance and strategy in New York City when I decided to change what I was doing entirely, and join the Open Source Hardware and DIY Hardware and Physical Computing movements. I had no idea it would have such an effect on how I think, and what I now think is important. It’s been a crazy ride, and it’s resulted in meeting more people than I ever could have imagined. I’ve even gotten a chance to travel to some amazing places to talk about Open Source Hardware, and the future of computing with scientists and engineers who know much more than I do.

I’m not talking about the Silicon Valley type of “future of computing”: smaller, faster, lower power x86 architecture. Don’t get me wrong, Silicon Valley is great. But it’s all about gunning for incremental improvement on the same architecture that computers have been running for years.

About a year ago, I started asking myself, I wonder what the future of computing is? Are we going to be using x86 architecture machine with motherboards and processors and ram chips and graphics cards forever? I wondered who’s actually thinking about that problem fundamentally, or differently than the mainstream group of people publishing in the old ivory tower institutions like some of the ones up in Boston, for instance.

I made a list of people and places I wanted to go, to meet with people and ask them, “what is the future of computing?” “What is the future of computation?” “What is the future of structure and architecture?” “What is new and different in computation?” “How will the future get developed: in a company? In an institution? By a community of Open Source hackers?”

My list of people to interview was pretty long, but included a few places like the Cambridge and Oxford College, MIT, Stanford Institute, Santa Fe Institute, the Army War College, Los Alamos Labs, NASA. So basically, a bunch of places out of my league. But I figured, why the heck not? So I made a bunch of phone calls, and found some very interesting people. Some of them were snotty, others were full of themselves, but almost everyone I met had one thing in common: they were defensive and protective of their ideas. It didn’t feel right.

Then I found the Santa Fe Institute. It’s a think tank in the middle of New Mexico, perched up on a hill overlooking desert and shrubs. And there are all kinds of people there who share one thing in common: asking weird questions about the future of algorithms and computing in ways that no one else does.

So I flew there, and spent a week and a half sharing ideas, talking to people about my problem, and meeting all types of researchers from different disciplines and fields of study…

And that’s how I met David Ackley. Over the next 6 months, Dave and I and the guys at Liquidware had some pretty deep, intense, and off the wall conversations about the future of computers.

And since we’re all hackers at heart, we decided to do something about it: we started a project called, appropriately, “The Santa Fe Project.”