Archive for May, 2009

So You Got an Arduino

Posted in Uncategorized on May 14th, 2009 by Aviv Ben-Yosef – 2 Comments

After playing around a bit with my new Arduino, I’ve gathered a list of a few things that I wish I knew when I started, as it would have saved some of my time. Hope it helps someone. Happy hacking!

There’s a builtin LED
This one I didn’t get right away. There’s a reason most of the examples in the tutorial sections refer to LEDs on pin 13 – there’s a small LED on the Duemilanove that’s already connected to that pin. It shines in orange (just like the TX/RX LEDs) if you write to that pin, but, of course, one can connect something else to that pin to use it.

That little button is the RESET button
This one might just be me being an idiot. I thought that little push button was a general purpose one. Well it’s not. It’s a reset button – whenever it gets pressed it resets the sketch running to the start. Boy, did I spend a lot of time pressing it and trying to debug my code til I figured it out…

There are builtin “software” pull-up resistors
Once you get you should connect a push-button, you might notice that every tutorial says you should use a pull-up resistor. Well, it turns out you can simply use a software one on the Arduino, and there’s no need to conenct one. After setting up the push-button pin as input:

pinMode(buttonPin, INPUT);

Simply tell the Arduino you need a pull-up resistor connected to it:

digitalWrite(buttonPin, HIGH);

For more information, read here.

The “Serial” library doesn’t really require a serial connection
Even though Duemilanoves and other new Arduino-boards only have a USB connection, it turns out that the Serial library can still be used. Whatever you write using it shows up in the Serial Monitor in the development IDE and you can send data to the Arduino using it too!

You should follow me on twitter here.

My “Hello, Arduino”

Posted in Uncategorized on May 14th, 2009 by Aviv Ben-Yosef – Be the first to comment

I ordered an Arduino Duemilanove a few months ago, and other than simply testing it to see that it starts up I haven’t touched it. It’s been lying on my desk, making me feel guilty every time I saw it.

Today, having a few spare hours and because I just finished reading “Programming Embedded Systems”, I decided it was time to finally do something with it.

I spent ~3 hours soldering the Proto-Shield that came with it. It was the first time I ever did any soldering and I think it turned out OK, after some help from Dad.

Then, I made a simple ‘Hello, World’ application that changes LEDs according to a button press. What can I say, the amount of satisfaction from such a simple thing is so big! Maybe, it has to do with the fact that as a software developer, I rarely do things that have a physical effect.


Original Video – More videos at TinyPic

You should follow me on twitter here.