Arduinos


Setup Stuff for Arduino on the linux machines
Linux is something of a stickler for permissions on devices (as might be expected of a 'real' operating system :-).

As a result, users who want to use the arduino programming should send mail to mcgrew AT cs.rutgers.edu. You have to be added to the "lock,uucp,dialout" groups, which will allow you to set the correct usb port (/dev/ttyACM0) to talk to the arduino. We're working on a more user friendly fix, but for now, ask and ye shall receive (but you gotta ask.)

The best place to start is http://arduino.cc, which has excellent how-tos, with code-samples, a language reference, and chatter about new and cool things to do with 'em.

Here's a quick how-do-I-run-this-bloody-thing:


> Having some trouble understanding this Arduino thing.
> 1) What format should the sketch file have? In other words, what
>file extension should I give files that I copy from another source?
> (I managed to get a file loaded by copy and paste, but how do I OPEN a file?

.c or .cpp are ok.  The file is just text.  You open a file in the
arduino program (the one that runs on the laptop/whatever is the other
end of the usb) You can edit it inside the arduino program, but its
not necessary.  Basic c-ish rules apply...

File -> Open



> 2) After I get the file uploaded, how do I RUN it? I don't see a
>RUN command anywhere.


Once you upload the file (little "->" on the window, or File -> Upload),
it should just run.  You can use the "serial monitor" 
Tools -> Serial Monitor to see outputs.  You should check the code
first (little check-mark on the window, or Sketch -> Verify/Compile)



> 3) How can I stop it?

Unplug it :-)


> 4) How can I erase the file for a new one?

It overloads -- it can only run one program at a time.  Just upload a
new file, and the old one is gone.



> 5) Do I need to have the wiring done on the breadboard (or directly
> attached) before I run the file?

Nope.



> 6) How do I know when I need an external power supply vs the USB power only?

You can use either.  If you have the USB, you don't need the external.
If you have the external, you don't need the USB (for instance when
you have a working whateveritis, and don't need to see output or
something.)



> 7) How do I shut everything down safely?

Grasp plug.  Yank.  :-)


> 8) Is the program stored in the Arduino with the power off or
> disconnected, or do I have to reload it each time?

Yes, it saves it, and when powered up, starts running it again.


> 9) If it is stored there, how can I see it next time I power up?

You can't, exactly.  What's uploaded to the Arduino is hex-code (that
is, the compiled program), not source.  You can dump the file with a
program called "avrdude" (its intended for flashing another device
with the compiled program without having to hook it up and
recompiling, etc.)  see

http://forum.arduino.cc/index.php/topic,6150.0.html


The best how-to-do-something-simple-so-I-learn-it collection I've found is from the wonderfully-named SparkFun Inventor's Kit, whose manual is full of detailed examples.

Also, some sample Instructional Videos pulled from the net