A Beginner's Arduino Guide/Arduino Language
A Beginner's Arduino Guide/Arduino Language
Language
< A Beginner's Arduino Guide(Redirected from Arduino Language)
Jump to navigation Jump to search
The Arduino Language is the set of words, expressions and rules that are used to create Arduino
Sketches.
The Arduino Language allows for the use of any functions from the 'AVR Libc' which is a subset
of the standard C library for Atmel AVR 8-bit RISC micro-controllers
Arduino Keywords
The keywords used to create the sketches can be divided into three types- Functions ,Structures
and Values ( Values can be either Constants or Variables).
Below are a non-exhaustive list of standard Arduino sketch words, to add words, new libraries
can be imported into the IDE.
Functions
are small groups of code that do a single task or group of tasks (they have one function). they
include
Category Keyword
pinMode()
digitalWrite()
Digital I/O
digitalRead()
analogReference()
analogRead()
Analog I/O
analogWrite() - PWM
analogReadResolution()
Due & Zero only analogWriteResolution()
millis()
micros()
Time delay()
delayMicroseconds()
min()
max()
abs()
constrain()
Math
map()
pow()
sqrt()
sin()
cos()
Trigonometry
tan()
isAlphaNumeric()
isAlpha()
isAscii()
isWhitespace()
isControl()
isDigit()
isGraph()
Characters
isLowerCase()
isPrintable()
isPunct()
isSpace()
isUpperCase()
isHexadecimalDigit()
randomSeed()
Random Numbers random()
attachInterrupt()
External Interrupts detachInterrupt()
interrupts()
Interrupts noInterrupts()
Serial
Communication Stream
Keyboard
USB (32u4 based boards and Due/Zero only) Mouse
Structures these are words used to create a flow or structure in the program. they include
Category Keyword
setup()
Overall Structure loop()
if
if...else
for
switch case
while
Control Structures do... while
break
continue
return
goto
= (assignment operator)
+ (addition)
- (subtraction)
Arithmetic Operators * (multiplication)
/ (division)
% (modulo)
Category Keyword
== (equal to)
!= (not equal to)
< (less than)
Comparison Operators > (greater than)
<= (less than or equal to)
>= (greater than or equal to)
&& (and)
|| (or)
Boolean Operators
! (not)
& (bitwise and)
| (bitwise or)
^ (bitwise xor)
Bitwise Operators ~ (bitwise not)
<< (bitshift left)
>> (bitshift right)
++ (increment)
-- (decrement)
+= (compound addition)
-= (compound subtraction)
*= (compound multiplication)
Compound Operators
/= (compound division)
%= (compound modulo)
&= (compound bitwise and)
|= (compound bitwise or)
* dereference operator
Pointer Access Operators & reference operator
; (semicolon)
{} (curly braces)
// (single line comment)
Syntax /* */ (multi-line comment)
#define
#include
Values
these act like containers and hold a certain value they may be constant which implies a container
whose value that doesn't change throughout the program or a variable, which implies a container
whose value that does change.
Category Keyword
HIGH | LOW
INPUT | OUTPUT | INPUT_PULLUP
LED_BUILTIN
Constants true | false
integer constants
floating point constants
void
boolean
char
unsigned char
byte
int
unsigned int
word
Data Types long
unsigned long
short
float
double
string - char array
String - object
array
char()
byte()
int()
Conversion word()
long()
float()
variable scope
static
Variable Scope & Qualifiers volatile
const
sizeof()
Utilities PROGMEM
Categories:
One-page books
Book:A Beginner's Arduino Guide
Navigation menu
Not logged in
Discussion for this IP address
Contributions
Create account
Log in
Book
Discussion
Read
Edit
View history
Search
Main Page
Help
Browse
Cookbook
Wikijunior
Featured books
Recent changes
Donations
Random book
Using Wikibooks
Community
Reading room
Community portal
Bulletin Board
Help out!
Policies and guidelines
Contact us
Tools
What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Sister projects
Wikipedia
Wikiversity
Wiktionary
Wikiquote
Wikisource
Wikinews
Wikivoyage
Commons
Wikidata
Print/export
Create a collection
Download as PDF
Printable version
Languages
Add links
Privacy policy
About Wikibooks
Disclaimers
Mobile view
Developers
Statistics
Cookie statement