Let's Make Robots!

Getting into Arduino

   Well my friends, I think its time for me to enter the world of arduino.  After working on my last project (I will post it soon, its for the google science fair so I just have to finish up it's website.) I have deciced ill have a go at arduino.  The reason I came to this conclusion is I needed something that can do simple multi-tasking.  During my google science fair project (That I will post soon to LMR) I needed to do two things at once.  The first was very simple.  I just wanted it to go down and come back a little to the side of the first path down and keep doing that until it had covered a certain area.  So that was simple, but the problem came when I wanted to do that while taking measurements from a sensor and light upng to pause, but I did not think I could do that with the picaxe.  So my next project is going to be more complex, so I was planning on using multiple picaxes but instead thought "Why don't I try an arduino?"  So thats were I am now.  I am planning on getting the Sparkfun Inventors kit

(http://www.sparkfun.com/products/10173) to play with/learn with and I am going to start simple.  I also think learning this would be good for me later.  So I ask you for any advise or things that have helped you with the arduino. 

P.S.  The only thing that I am dreading is learning a different kind of code.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I think Picaxe has the best manual for this type of question. Below is a link for Picaxe manual 3. This manual covers how to plug stuff in, how to read sensors and control motors and lights. Run through this manual and I think you will quickly see the differences between a digital I/O and an analog one.

Picaxe Manual 3 --how to plug stuff in.

Now, to answer your questions quickly here...

  • Digital inputs read on or off. If it is above about 2/3 of Vdd, it is on, lower than that it is off. This on and off is usually called "high and low".
  • Analog inputs read voltages that can change. Think volume knob vs. up/down buttons. Up down buttons would be digital. The volume knob would be analog. Many sensors will put out a changing voltage to indicate their reading. A analog pin or ADC (analog/digital converter) can read this change in voltage, and convert it to a number we can use.
  • communication can be done in countless ways. Different ways of talking include, UART serial, i2c, spi and more. In terms of communication hardware, you can use cheap RF, cheap IR, fancy IR, Bluetooth or a peice of wire!
  • PWM is just a fancy way of turning an output on and off really fast. Lets say you have a light or motor or something hooked up to the microcontroller. If you wanted the motor slower or the light dimmer, you need to reduce the power going to it. One way of doing this is to pulse the power on and off (wicked fast). If there is a 50% duty cycle, it means the power is on (high) 50% of the time and off (low) %50 of the time. We can very the % of high and low and thus, control the speed of a motor or the brightness of a LED.

Hey guys

Can some one tell me some basics about arduino, becasue i am new to it. i know very basic C language...but i dont know what are all the Inputs on the arduino for.......

1. What is the Analog Input used for...can u please give me some examples.

2. What is the Digital input used for...examples plz.

3. communication...example plz.

and i have no idea what PWM is for......i have used it for LED blinking but what else can it be used for???

I am proballbly newer than you but, an anolog input can be hooked up to a ldr to detect light levels. A digital input is useful for a switcth (if pin 4=1 goto.....). PWM is usefull for speed controll of small moters.

Oh well C++ isn't hard. I got the basics in less than 3 days (1-2 hours per day). Anyways, you already know BASIC and that'll help you a lot. I mean, all languages have similar structure flow and stuff. Here's the tutorial I'm learning with: http://www.learncpp.com/. I'm at 7.4a, but Arduino programming doesn't really require to go this far. It's never a bad thing though.


I know someone who had gotten a 3D printer and was wondering if I knew C++.  That was another reason I was wanting to learn it.  Thanks again.  That will help a lot.

If you know C or C++, you will have no problem learning the Arduino language. It's actually only a new library you'll nead to learn and it's really easy. Just take a look at everything here one or two times and you should be good to go: http://arduino.cc/en/Reference/HomePage.

As to multi-tasking, I don't think Arduino can truly multi-task, but it can loop pretty fast with a very small delay between tasks, so the result is similar. The kit you mentioned is cool, but I guess you could be more satisfied by choosing your own sensors, motors, LEDs, etc... if you already have a concrete robot idea.

Good luck

Thanks for the link.  I think I might start going threw it now.  The problem is I only know basic so ill have to learn which won't be to bad.  I think I might just get the package so everything I need is there and it comes with simple projects.  Plus you can never have enough sensors, motors, LEDS, servos, and other little goodies.