Running a program on an Arduino.
The best references for getting started with the Arduino are supplied with the IDE: the Help menu includes a section for Getting Started which covers operation and Reference which covers the language.
In addition, the main Arduino site has similar introduction pages:
The Arduino Tutorial Foundations page addresses many basic ideas and syntax. If you have no programming experience at all, please be sure to look at First Sketch, Variables, and Functions. For more beginner help, please remember that the Arduino language is a subset of C++, so many elementary C or C++ tutorials online can cover the basics of variables, functions, control flow, and program logic, e.g., anything which relates purely to the internal logic of a computation rather than the physical interface.
delay
statements; the units are milliseconds.It can be quite difficult to debug complex programs when the serial port is the only source of information, and especially when it is also being used for transmitting data back to the hosts. It can be helpful to use digital output pins for indicating single bits of program state and viewing the voltages on the oscilloscope.