Hacker News new | past | comments | ask | show | jobs | submit login
The Absolute Beginner's Guide to Arduino (forefront.io)
210 points by achalkley on Jan 1, 2013 | hide | past | favorite | 29 comments



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.


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!).


That's a great idea. I felt a great sense of accomplishment dismantling a simple finger torch and putting it in a circuit connected to an Arduino UNO and varying the current going to it. It's like programming but in real life :)


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...

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.


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!


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!


Good idea.


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.


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...


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...


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/


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


As a complete n00b to all this stuff there seems to be some more stuff I need to look in to, thanks!


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?


I'm assuming you want to do some low-level hardware integration with your Pi, in which case I would suggest starting by taking a look at this page:

http://elinux.org/RPi_Low-level_peripherals

It provides some information on how to interface with the GPIO pins with a multitude of programming languages. Granted it may not be an absolute beginner guide, it still has a lot of useful information. If I can find another guide I'll comment back here.

I'd also want to echo something that the other reply to your comment mentioned, which is that you should seriously consider starting with an Arduino if you want to do some lower-level programming/interfacing with hardware. From my personal experience, there's a little more documentation on that sort of thing with Arduino than the Raspberry Pi. Additionally, the Raspberry Pi's GPIO pins are not fault tolerant, which means you could damage your Pi if you wire up your hardware improperly. If I remember correctly, Arduinos typically have some voltage fault tolerance (at least there are variants which do), and even if you fry the actual microcontroller chip on the board, it can be removed and replaced for a couple of dollars. Once you've got some experience on an Arduino board, then I'd recommend doing some of the low-level stuff on the Raspberry Pi.


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.


> 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


How awesome! I didn't know that :)


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.


> 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...

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.


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.


> 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.


Oh wow.


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.


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.


  > 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?


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.


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


I'm glad you know where now :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: