0% found this document useful (0 votes)
45 views8 pages

A Beginner's Arduino Guide/Arduino Language

The Arduino language is based on C and C++ and allows the use of functions from the AVR Libc standard C library. It uses keywords like functions, structures, and values (constants and variables) to create sketches. Functions perform single or grouped tasks, structures create program flow, and values hold data. Common functions include digital I/O, analog I/O, time, math, and serial communication functions. Operators, data types, and other syntax elements are also discussed.

Uploaded by

DoruGiurca
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views8 pages

A Beginner's Arduino Guide/Arduino Language

The Arduino language is based on C and C++ and allows the use of functions from the AVR Libc standard C library. It uses keywords like functions, structures, and values (constants and variables) to create sketches. Functions perform single or grouped tasks, structures create program flow, and values hold data. Common functions include digital I/O, analog I/O, time, math, and serial communication functions. Operators, data types, and other syntax elements are also discussed.

Uploaded by

DoruGiurca
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

A Beginner's Arduino Guide/Arduino

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 is based on C and C++

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

The language is made up of keywords that are written based on rules.

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()

Advanced I/O  tone()


Category Keyword
 noTone()
 shiftOut()
 shiftIn()
 pulseIn()

 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()

Bits and Bytes  lowByte()


 highByte()
 bitRead()
Category Keyword
 bitWrite()
 bitSet()
 bitClear()
 bit()

 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

 This page was last edited on 7 February 2018, at 23:25.


 Text is available under the Creative Commons Attribution-ShareAlike License.;
additional terms may apply. By using this site, you agree to the Terms of Use and Privacy
Policy.

 Privacy policy
 About Wikibooks
 Disclaimers
 Mobile view
 Developers
 Statistics
 Cookie statement

You might also like