I am a new user to arduino and circuits in general. If someone could give me some general guidance as to how to set up an arduino board it would be greatly appreciated.
My current goal is to set up a little ultrasonic and infrared distance and motion sensing device. I've already bought an arduino board and two sensors; they are coming in the mail. I have no idea as to how to set up a board as I have not done this before, can you offer me some general guidance as to how to do this?
Well, I'm new too and I don't know much about the devices you have. But first you can start by getting the arduino IDE which is available on the website on the downloads page. Use the installer if you arent too familiar with manually installing drivers. After that, you should have a (usually blue) USB cable in which you can hook up to your arduino-capable SainSmart board. Once its hooked up you can go in the settings on the arduino IDE and set the COM port for the board, which may already be set. Once that's done, you can start a new sketch/project. You have 2 functions: setup () and loop ()
setup() is ran one, before loop() goes into effect. loop () runs throughout your program, it's equivalent to your main () function if you have any programming background.
You can start playing with arduino by looking up a tutorial on how to flash an LED. Pin 13 has an LED built in to it. I hope i helped.
Hi, thanks yeah that is helpful. Do you know what type of components I should buy? I was checking the page, it looks like I will need some small resistors and wires.
You do not need any hardware to start learning.
Download the IDE and install it now.
Start it and go to file > example > 01.Basics.
There you will find the "blink" sketch, open it.
Have a look at what's happening in there, and to see if you understand that.
Take a peek at the other sketch there and see if you get that.
Just sniff a bit.
After the SainSmart board arrives, you can upload the blink sketch to it and see what happens.
Now the fun can begin.
Start making small changes to that blink sketch and see if that does what you expect it to do.
Don't think you can order a few PCB's today and use them the way you imagined tomorrow.
It will take some time and you need to take the time to learn.
Ignore the Blink sketch! Using delay() to time anything is a horrible way to start out. It is like teaching a beginning driver to use the parking brake to control speed for their first lesson.
I don't agree with polymorph, but I'm not about to argue with someone with his skill and knowledge.
Bottom line is: start small, figure out what you think is going on, try some modifications, if you get hung up, show us/them what you have done and ask pertinent questions, and LEARN. then go on to more extensive, or advanced examples and do the same. Once you get familiar with the board and the software, then branch out to new sensors and such. Do the examples before you dream up some project like nuclear reactor control systems.
When it comes to the use of delay() for timing as used in the Blink sketch, it is down to opinion. I am -not- an experienced programmer. I just think it really leads a newbie down the garden trail, as it is not scalable. You cannot use it to time unsynchronized events or alter the timing between synchronized events in any realistic way.
It is a gigantic waste, but does provide some insight to operation for the newbee, noobie, tyro....
But, I must agree. If you are doing anything beyond utilizing the whole board for blinking the LED, you're pretty much better off without using it.