August 10, 2010, at 09:04 AM
by David A. Mellis -
Changed lines 1-199 from:
(:title Extended Reference:)
Language Reference (extended)
See the libraries page for interfacing with particular types of hardware.
The Arduino language is based on C/C++ and supports all standard C constructs and some C++ features. It links against AVR Libc and allows the use of any of its functions; see its user manual for details.
(:table width=100% border=0 cellpadding=5 cellspacing=0:)
(:cell width=33%:)
Structure
Control Structures
Further Syntax
Arithmetic Operators
- = (assignment operator)
- + (addition)
- - (subtraction)
- * (multiplication)
- / (division)
- % (modulo)
Comparison Operators
- == (equal to)
- != (not equal to)
- < (less than)
- > (greater than)
- <= (less than or equal to)
- >= (greater than or equal to)
Boolean Operators
Pointer Access Operators
Bitwise Operators
- & (bitwise and)
- | (bitwise or)
- ^ (bitwise xor)
- ~ (bitwise not)
- << (bitshift left)
- >> (bitshift right)
Compound Operators
- ++ (increment)
- -- (decrement)
- += (compound addition)
- -= (compound subtraction)
- *= (compound multiplication)
- /= (compound division)
- &= (compound bitwise and)
- |= (compound bitwise or)
(:cell width=33%:)
Variables
Constants
Data Types
Conversion
Variable Scope & Qualifiers
Utilities
(:cell width=33%:)
Functions
Digital I/O
Analog I/O
Advanced I/O
Time
Math
Trigonometry
Random Numbers
Bits and Bytes
External Interrupts
Interrupts
Communication
Looking for something else? Try the list of community-contributed code.
(:tableend:)
to:
April 01, 2010, at 11:14 PM
by David A. Mellis - changing to three columns
Deleted line 5:
Changed line 9 from:
to:
Added line 79:
Changed lines 129-133 from:
Reference
(:cell width=50%:)
to:
April 01, 2010, at 04:36 PM
by David A. Mellis -
Changed line 93 from:
to:
April 01, 2010, at 04:33 PM
by David A. Mellis -
Changed lines 139-140 from:
to:
April 01, 2010, at 04:33 PM
by David A. Mellis -
Changed lines 13-15 from:
to:
Changed lines 137-140 from:
to:
Changed lines 142-145 from:
to:
Changed lines 149-151 from:
- shiftOut(dataPin, clockPin, bitOrder, value)
- unsigned long pulseIn(pin, value)
to:
Changed lines 153-157 from:
to:
Changed lines 159-166 from:
to:
Changed lines 168-171 from:
to:
Changed lines 174-177 from:
to:
Changed lines 188-190 from:
to:
April 01, 2010, at 02:35 PM
by David A. Mellis - adding tone() and noTone()
Added lines 147-148:
March 09, 2010, at 06:10 AM
by Tom Igoe -
Added lines 4-6:
See the libraries page for interfacing with particular types of hardware.
March 09, 2010, at 06:09 AM
by Tom Igoe -
February 06, 2010, at 03:31 AM
by David A. Mellis -
Deleted lines 65-66:
January 28, 2010, at 07:26 PM
by Paul Badger -
Changed lines 4-5 from:
The Arduino language is based on C/C++ and supports all standard C constructs and some C++ features. It links against AVR Libc and allows the use of any of its functions; see its user manual for details.
to:
The Arduino language is based on C/C++ and supports all standard C constructs and some C++ features. It links against AVR Libc and allows the use of any of its functions; see its user manual for details.
May 08, 2009, at 08:31 AM
by David A. Mellis -
Changed lines 194-203 from:
to:
February 21, 2009, at 04:06 PM
by David A. Mellis -
Changed lines 178-183 from:
to:
February 21, 2009, at 04:02 PM
by David A. Mellis -
Added lines 175-178:
February 08, 2009, at 09:00 AM
by David A. Mellis -
Added line 99:
Added line 112:
February 08, 2009, at 07:20 AM
by David A. Mellis -
Added line 149:
January 06, 2009, at 04:28 PM
by Paul Badger -
Added line 116:
November 02, 2008, at 05:01 AM
by David A. Mellis -
Changed lines 2-3 from:
Arduino Reference (extended)
to:
Language Reference (extended)
November 02, 2008, at 05:01 AM
by David A. Mellis -
Added lines 108-109:
October 20, 2008, at 05:26 PM
by David A. Mellis -
Changed lines 189-190 from:
to:
Looking for something else? Try the list of community-contributed code.
October 20, 2008, at 05:25 PM
by David A. Mellis -
Changed lines 106-111 from:
to:
October 18, 2008, at 11:02 AM
by David A. Mellis -
Deleted lines 108-109:
Changed lines 112-114 from:
to:
Deleted line 115:
Deleted line 119:
Deleted line 120:
October 18, 2008, at 01:59 AM
by Paul Badger -
Changed lines 114-115 from:
to:
October 18, 2008, at 01:58 AM
by Paul Badger -
Added line 125:
October 11, 2008, at 04:44 PM
by David A. Mellis -
Deleted line 124:
October 11, 2008, at 02:51 PM
by David A. Mellis -
Changed lines 114-116 from:
to:
October 05, 2008, at 12:50 PM
by Paul Badger -
Changed lines 23-24 from:
to:
September 18, 2008, at 08:58 AM
by David A. Mellis -
Deleted lines 9-10:
In Arduino, the standard program entry point (main) is defined in the core and calls into two functions in a sketch. setup() is called once, then loop() is called repeatedly (until you reset your board).
September 06, 2008, at 03:04 PM
by Paul Badger -
Added lines 110-111:
September 06, 2008, at 02:19 PM
by Paul Badger -
Changed line 35 from:
to:
September 05, 2008, at 08:12 PM
by Paul Badger -
Added line 35:
May 07, 2008, at 03:44 PM
by David A. Mellis -
Changed line 35 from:
to:
April 30, 2008, at 09:49 AM
by David A. Mellis -
Deleted lines 3-4:
The foundations page has extended descriptions of some hardware and software features.
April 23, 2008, at 11:30 PM
by David A. Mellis -
Changed line 8 from:
(:table width=90% border=0 cellpadding=5 cellspacing=0:)
to:
(:table width=100% border=0 cellpadding=5 cellspacing=0:)
March 31, 2008, at 07:26 AM
by Paul Badger -
Changed lines 4-5 from:
foundations page has extended descriptions of some hardware and software features.''
to:
The foundations page has extended descriptions of some hardware and software features.
March 31, 2008, at 07:26 AM
by Paul Badger -
Added lines 4-5:
foundations page has extended descriptions of some hardware and software features.''
March 29, 2008, at 12:30 PM
by David A. Mellis -
Added lines 173-177:
March 29, 2008, at 10:19 AM
by David A. Mellis -
Added line 153:
- map(value, fromLow, fromHigh, toLow, toHigh)
March 28, 2008, at 07:14 PM
by David A. Mellis -
Added line 135:
February 28, 2008, at 10:49 AM
by David A. Mellis -
Added line 85:
January 17, 2008, at 11:02 AM
by David A. Mellis - because hardware information doesn't belong in the programming language / api reference
Deleted line 133:
January 16, 2008, at 11:40 AM
by Paul Badger - people want to know where to find this info - why not here?
Added line 134:
January 11, 2008, at 01:05 PM
by David A. Mellis - moving the analog pin description to the hardware tutorials on the playground.
Deleted line 133:
January 11, 2008, at 12:29 PM
by David A. Mellis - moving variable scope to the code tutorials section (in the playground)
Deleted line 107:
November 23, 2007, at 07:13 PM
by David A. Mellis - we're documenting the Arduino language here, not AVR LIBC.
Changed lines 155-156 from:
to:
November 23, 2007, at 06:02 PM
by Paul Badger -
Changed lines 86-88 from:
to:
November 23, 2007, at 06:02 PM
by Paul Badger -
Changed line 85 from:
to:
November 23, 2007, at 06:01 PM
by Paul Badger -
Added line 85:
Changed lines 88-89 from:
to:
November 23, 2007, at 05:46 PM
by Paul Badger -
November 23, 2007, at 05:45 PM
by Paul Badger -
Changed lines 85-86 from:
to:
November 23, 2007, at 05:11 PM
by Paul Badger -
Changed lines 154-155 from:
to:
November 21, 2007, at 03:11 PM
by Paul Badger -
Deleted lines 118-119:
Changed lines 124-125 from:
to:
November 21, 2007, at 03:10 PM
by Paul Badger -
Added lines 119-120:
Changed lines 126-127 from:
to:
November 21, 2007, at 10:33 AM
by David A. Mellis - adding sqrt
Changed lines 153-154 from:
to:
November 21, 2007, at 10:27 AM
by David A. Mellis -
Changed lines 152-153 from:
to:
November 21, 2007, at 10:24 AM
by David A. Mellis -
Changed lines 152-153 from:
to:
November 21, 2007, at 10:22 AM
by David A. Mellis -
Deleted lines 147-149:
Added lines 153-157:
November 21, 2007, at 10:17 AM
by David A. Mellis - adding trig functions (instead of general math.h page)
Changed lines 148-150 from:
to:
November 17, 2007, at 11:56 PM
by Paul Badger -
Changed lines 55-57 from:
to:
November 17, 2007, at 11:55 PM
by Paul Badger -
Changed lines 55-57 from:
to:
November 17, 2007, at 11:46 PM
by Paul Badger -
Changed lines 55-57 from:
to:
November 17, 2007, at 11:45 PM
by Paul Badger -
Added lines 54-57:
November 13, 2007, at 09:49 PM
by Paul Badger -
Changed line 119 from:
- Atmega168 pin mapping chart
to:
November 13, 2007, at 09:48 PM
by Paul Badger -
Changed line 119 from:
to:
- Atmega168 pin mapping chart
November 06, 2007, at 04:34 PM
by Paul Badger -
Changed line 130 from:
to:
November 06, 2007, at 04:33 PM
by Paul Badger -
Added line 130:
October 15, 2007, at 05:55 AM
by Paul Badger -
Changed lines 61-62 from:
to:
September 08, 2007, at 10:23 AM
by Paul Badger -
Added line 88:
August 31, 2007, at 11:17 PM
by David A. Mellis -
Added lines 76-82:
Changed lines 107-113 from:
to:
August 31, 2007, at 11:16 PM
by David A. Mellis - moved discussion of AVR libraries to the introduction of this page.
Changed lines 166-172 from:
to:
August 31, 2007, at 11:14 PM
by David A. Mellis -
Deleted lines 14-15:
Added lines 76-78:
August 31, 2007, at 11:14 PM
by David A. Mellis - don't need a tutorial on functions and variables here.
Changed lines 14-15 from:
to:
August 31, 2007, at 11:13 PM
by David A. Mellis - moving reference to bottom of first column
Deleted lines 111-112:
Added lines 117-118:
August 31, 2007, at 11:13 PM
by David A. Mellis - AREF pin doesn't belong here; instead we should have a function to put it in use.
Deleted lines 118-121:
August 31, 2007, at 11:11 PM
by David A. Mellis - removing the pin mappings; there are links from the port manipulation reference instead.
Deleted line 120:
August 31, 2007, at 10:45 PM
by David A. Mellis -
Changed line 1 from:
to:
(:title Extended Reference:)
August 31, 2007, at 10:45 PM
by David A. Mellis -
Changed lines 10-11 from:
An Arduino program run in two parts:
to:
In Arduino, the standard program entry point (main) is defined in the core and calls into two functions in a sketch. setup() is called once, then loop() is called repeatedly (until you reset your board).
August 31, 2007, at 10:37 PM
by David A. Mellis -
Changed lines 2-7 from:
Arduino Reference
Extended Version
The Arduino language is based on C/C++.
to:
Arduino Reference (extended)
The Arduino language is based on C/C++ and supports all standard C constructs and some C++ features. It links against AVR Libc and allows the use of any of its functions; see its user manual for details.
August 11, 2007, at 09:46 AM
by Paul Badger -
Added lines 114-115:
Added lines 120-122:
Changed lines 124-125 from:
to:
July 17, 2007, at 12:03 PM
by Paul Badger -
Changed lines 66-67 from:
to:
July 17, 2007, at 11:58 AM
by Paul Badger -
Changed lines 117-118 from:
to:
July 17, 2007, at 11:55 AM
by Paul Badger -
July 17, 2007, at 11:47 AM
by Paul Badger -
Changed lines 168-169 from:
Arduino 0008 contains headers for the following libraries:
to:
July 17, 2007, at 11:45 AM
by Paul Badger -
Changed lines 166-173 from:
to:
AVR Libraries
Arduino 0008 contains headers for the following libraries:
July 17, 2007, at 11:36 AM
by Paul Badger -
Deleted lines 79-82:
Variables are expressions that you can use in programs to store values, like e.g. sensor reading from an analog pin. They can have various types, which are described below.
Data Types
July 17, 2007, at 11:35 AM
by Paul Badger -
Changed lines 106-107 from:
Constants are labels for certain values which are preset in the Arduino compiler. You do not need to define or initialize constants. Arduino includes the following pre-defined constants.
to:
Deleted lines 157-158:
These functions allow you to trigger a function when the input to a pin changes value.
Deleted lines 162-163:
Used for communication between the Arduino board and a computer or other devices. This communication happens via the Arduino board's serial or USB connection and on digital pins 0 (RX) and 1 (TX). Thus, if you use these functions, you cannot also use pins 0 and 1 for digital i/o.
July 17, 2007, at 11:33 AM
by Paul Badger -
Added line 145:
July 17, 2007, at 11:30 AM
by Paul Badger -
Deleted lines 15-17:
setup() is preparation, and loop() is execution. In the setup section, always at the top of your program, you would set pinMode, initialize serial communication, etc. The loop section is the code to be executed -- reading inputs, triggering outputs, etc.
July 17, 2007, at 11:29 AM
by Paul Badger -
Added lines 1-178:
(:title Reference:)
Arduino Reference
Extended Version
The Arduino language is based on C/C++.
(:table width=90% border=0 cellpadding=5 cellspacing=0:)
(:cell width=50%:)
Structure
An Arduino program run in two parts:
setup() is preparation, and loop() is execution. In the setup section, always at the top of your program, you would set pinMode, initialize serial communication, etc. The loop section is the code to be executed -- reading inputs, triggering outputs, etc.
Control Structures
Further Syntax
Arithmetic Operators
- plus (addition)
- - (subtraction)
- * (multiplication)
- / (division)
- % (modulo)
Comparison Operators
- == (equal to)
- != (not equal to)
- < (less than)
- > (greater than)
- <= (less than or equal to)
- >= (greater than or equal to)
Boolean Operators
Bitwise Operators
- & (bitwise and)
- | (bitwise or)
- ^ (bitwise xor)
- ~ (bitwise not)
- << (bitshift left)
- >> (bitshift right)
Compound Operators
- ++ (increment)
- -- (decrement)
- += (compound addition)
- -= (compound subtraction)
- *= (compound multiplication)
- /= (compound division)
- &= (compound bitwise and)
- |= (compound bitwise or)
Variables
Variables are expressions that you can use in programs to store values, like e.g. sensor reading from an analog pin. They can have various types, which are described below.
Data Types
Variable Scope & Qualifiers
Constants
Constants are labels for certain values which are preset in the Arduino compiler. You do not need to define or initialize constants. Arduino includes the following pre-defined constants.
Utilities
Reference
(:cell width=50%:)
Functions
Digital I/O
Analog I/O
Advanced I/O
- shiftOut(dataPin, clockPin, bitOrder, value)
- unsigned long pulseIn(pin, value)
Time
Math
Random Numbers
External Interrupts
These functions allow you to trigger a function when the input to a pin changes value.
Serial Communication
Used for communication between the Arduino board and a computer or other devices. This communication happens via the Arduino board's serial or USB connection and on digital pins 0 (RX) and 1 (TX). Thus, if you use these functions, you cannot also use pins 0 and 1 for digital i/o.
(:tableend:)