
The Absolute Beginner's Guide to Arduino - achalkley
http://forefront.io/a/beginners-guide-to-arduino
======
ssharp
I'm totally new to Arduino and hardware (also gained interest over the
holiday). There are some good docs on the Arduino website, but once you get
into less common components, it's weird to see how little info is out there.
Programmers are incredibly lucky to have so many amazing resources and I think
I've just taken that for granted.

I will say that Arduino has really sparked my imagination. I'm digging out
garbage electronics (an old clock radio for example), taking them apart, and
trying to figure out how to interface their components with Arduino.

~~~
evoxed
For those of us who already spend an inordinate amount of time digging through
bins of old and often dead electronics for components... I'm just glad that
Arduinos and other similar devices have made my hobbies _more_ acceptable (and
helpful!).

------
guynamedloren
If you're interested in Arduino and are familiar with js/node, check out
Johnny-Five (<https://github.com/rwldrn/johnny-five>).

 _"My goal for Johnny-Five is to create a framework for programming Arduino
Robots with nothing more then JavaScript. I believe that JavaScript,
inherently asynchronous and the platform that Node.js has built around this
paradigm, is the perfect environment for writing evented, streaming programs
for controlling the highly synchronous world of hardware."_ \-- via
[http://weblog.bocoup.com/javascript-arduino-programming-
with...](http://weblog.bocoup.com/javascript-arduino-programming-with-nodejs/)

I don't know anything about robotics or arduinos (though I've done a bit of
electronics hacking/tinkering throughout my life), but this project makes me
want to jump right in head first.

~~~
achalkley
You know I think I may have seen this guy's videos/post before. Seriously one
night I was just totally going around YouTube and just watching all the cool
stuff people were doing. It's contagious!

------
sachleen
Pretty good write up for beginners. I think you should add a link to
<http://arduino.cc/en/Tutorial/HomePage> in the Whats Next so people can see
what else they can do with the Arduino!

~~~
achalkley
Good idea.

~~~
JungleGymSam
The Arduino website has a nearly identical tutorial to yours. Which is
interesting because it was yours that prompted me to finally stop being
unreasonably afraid of experimenting with Arduino and buy one. So I did.

Congrats.

~~~
achalkley
Congrats to you too!

What you said prompted me to think of a tweet I saw from smashing magazine:

"It’s good to share what we know. You needn’t be the first, you’ll just help
if you’re the first that somebody finds."
<https://twitter.com/smashingmag/status/278041226622668800>

Whilst it's not exactly what you said I think the sentiment is the same...

------
carwithcookies
I also gifted myself an Arduino (Leonardo/Micro) over the holidays and have
had a lot of fun working through the basic exercises and thinking up
imaginative ways to use it.

Check out this Arduino for Beginners (In Comic Form) - probably particularly
good for those of you who gifted an Arduino to children, and links to other
resources in the last panels.

[http://www.jodyculkin.com/wp-
content/uploads/2011/09/arduino...](http://www.jodyculkin.com/wp-
content/uploads/2011/09/arduino-comic-latest.pdf)

------
kh_hk
Just as a tip for Arduino newcomers, if you want to put the UNO R3 into DFU
mode [1], just bridge these two pins together with a jumper or a cable for a
moment:

    
    
            ____________________
           | o       ···········
        RESET ---> + · ·
        GND -----> + · ·
          _|____
         |      |
         | USB  |
         |______|
           |
           |
    

Then, if you want to use the dfu-programmer[2], you need to apply a patch[3]
to make it work with the R3.

Being myself a complete newbie, I found it time consuming to reach the state
in which I knew how and what to do just to upload a new firmware.

[1]: If you want/are interested in playing with Arduino as an USB device.

[2]: <http://dfu-programmer.sourceforge.net/>

[3]: <https://aur.archlinux.org/packages/dfu-programmer/>

~~~
rediah
All this reminds me of days when I tried to hack my Hayes modem to increase
the speed from 300 to 900 bauds.

------
lylejohnson
This is a topic I've been interested in for some time now and this looks to be
at the right level (i.e. absolute beginner) for me, so thanks very much for
sharing.

Can anyone point me to a similar resource for the Raspberry Pi?

~~~
achalkley
I got my 5 yo daughter a Pi but I think there's several more layers of
complexity (and purchases) to get it going with hardware hacking. It's a more
fully fledged computer and can get people started with basic programming with
Scratch, then on to things like Python and then C if you dare :)

I went to a hacker space open house in Orlando (FamiLAB) and a colleague and I
were asking whats the difference between a Pi and an Arduino and a guy said
what do you want to do and I said make an LED flash...And he said to start
with an Arduino and I can see why now, if you want to get in to electronics
(and you already have a computer) an Arduino is the way to go.

A Raspberry Pi is a fully functional computer so you have to wait for it to
boot in to linux before it can do any other tasks. An Arduino is (almost)
instantly on and running you program. Both are great teaching and learning
tools but it depends what you want to do with them.

~~~
Joeboy
> A Raspberry Pi is a fully functional computer so you have to wait for it to
> boot in to linux before it can do any other tasks.

There's nothing to stop you programming the pi bare metal style like an
arduino. It's not as well documented but it's perfectly doable and quite fun.

<https://github.com/dwelch67/raspberrypi>

<http://www.raspberrypi.org/phpBB3/viewforum.php?f=72>

~~~
achalkley
How awesome! I didn't know that :)

~~~
tmuir
This is true of any processor. If you had the inclination and the proper
hardware to facilitate loading the machine instructions, you could program the
processor in your computer the same way.

The raspberry pi is a much more complex machine than the arduino. 32 bit
instructions vs 8 bit, 700MHz vs 20MHz clock frequency, GPU vs no GPU, 512MB
memory vs less than 1MB. There is so much going on in the pi's chip, that a
thorough technical reference manual could easily exceed 5000 pages, where as
everything you need to know about the arduino's processor will fit in less
than 500.

You certainly can make LEDs blink with a raspberry pi with your own non-OS
code, but the difference in the amount of code required vs doing it in an
arduino is pretty substantial.

~~~
Joeboy
> The raspberry pi is a much more complex machine than the arduino. 32 bit
> instructions vs 8 bit, 700MHz vs 20MHz clock frequency, GPU vs no GPU, 512MB
> memory vs less than 1MB

I have no arduino experience and am happy to be educated, but I don't see how
any of those things makes the pi harder to program. Maybe the instruction
set's harder, but that only matters if you're writing asm. There's more stuff
you _can_ do, but that doesn't get in the way if you just want to code
arduino-like stuff.

> You certainly can make LEDs blink with a raspberry pi with your own non-OS
> code, but the difference in the amount of code required vs doing it in an
> arduino is pretty substantial.

Here is some baremetal code that blinks LEDs on a pi:

[https://github.com/dwelch67/raspberrypi/blob/master/blinker0...](https://github.com/dwelch67/raspberrypi/blob/master/blinker01/blinker01.c)

It's not that bad, really. Admittedly some of the peripherals are much harder
work than that. I should add that I have nothing against the Arduino, but as a
n00b to baremetal / embedded style programming I'm not finding the pi
particularly gruelling. Maybe I just don't know what I'm missing.

~~~
tmuir
I haven't actually worked with the raspberry pi, but I'm currently working
with a similar processor, a Texas Instruments ARM Cortex A8 that runs at
720MHz. On my processor, you have to set up the PLL to take the 24MHz external
oscillator to 720MHz, configure several clocks for peripherals, set up the MMU
with a huge table of memory addresses and their cache settings, configure the
GPIO bank, Select the proper multiplexed setting for the actual pin that the
signal is output to, etc. This is all in C as well.

Are you saying that the code you linked is loaded with some sort of JTAG
device, and is the entirety of the code running on the chip, or is it run from
the command line?

Maybe Texas Instruments are just a bunch of sadists.

~~~
Joeboy
> Are you saying that the code you linked is loaded with some sort of JTAG
> device, and is the entirety of the code running on the chip, or is it run
> from the command line?

That's all the code _you_ need to write. You also need a firmware binary
supplied by the raspberry pi people. You write your binary and the firmware
binary to an SD card, and the pi boots and runs your code via some process
that is frankly opaque to me. Alternatively you can stick a bootloader on the
card and transfer your binary via an ftdi cable, which is a lot less hassle
while developing. All this is detailed in the repo I linked if you're
interested.

Using the onboard peripherals is admittedly fairly challenging, largely due to
the paucity of documentation available. Hopefully more documentation and
examples will emerge as more of us tinker with it.

I'm not yet in a position to compare and contrast to TI's stuff, but I have a
Stellaris Launchpad I intend to start playing with soon. Will be interesting
to see how it compares.

~~~
achalkley
Oh wow.

------
kylemaxwell
Excellent. I recently got my 9yo daughter started on those simple electronics
kits with various components mounted on a cardboard frame and springs for
terminals to interconnect them in various ways. But that's rekindled my _own_
interest in electronics (which I haven't really indulged in >15 years) and
I've been considering Arduino or some stuff from Parallax based on the DEF CON
badge from last summer.

~~~
achalkley
I got my 5 yo daughter a Pi and she's been playing around on Scratch (and
typing) and it's surprising how quickly they pick this stuff up. She guess
doing a minus number would move a sprite in the opposite direction!

I was experimenting writing libraries in C++ (I prefer a more OO interface to
things) so I created an AnologLed and DigitalLed class and showed my daughter
in the code how I made a red LED come on and she proceeded to make the orange
and blue ones come on too.

This stuff it the literacy of the 21st century.

~~~
apl

      > She guess doing a minus number would move a sprite in
      > the opposite direction!
    

I'm curious how that is possible. Did she just move a slider towards the
negative range? Randomly _guess_ it? Does she have a notion of continuity past
zero?

~~~
achalkley
She's got a concept of addition and subtraction.

I typed in the number and prefixed it with I am putting a funny symbol before,
and said they were before zero and that normal numbers had a plus in front but
it's hidden normally, then I asked which way do you think this will go and she
pointed left.

------
marcosdumay
Thanks a lot. I've just got one Arduino, and was wondering where to start :)

~~~
achalkley
I'm glad you know where now :)

