As promised in my previous article I have crafted together Glossary, Language Reference and Libraries in an easy printable format for you. The purpose of doing this was to make your life easy so that you can print the important stuff on a piece of paper. Hence keeping it ready for reference whenever you need it. I know the process of learning can be hard, I certainly want to keep you motivated for this endeavor of learning Arduino. That is why these efforts.
I have summarized glossary into word format, language reference and libraries into power point. I will attach the files at the end of this article so that you can simply print and begin!
What is Arduino language?
Arduino language can easily be mistaken as just another traditional low/mid level programming language like ‘C’ or ‘C++’ but believe me it is much more than that.
Low level programming language is close to the hardware, means you are programming to access directly internal registers, inputs, outputs and other features of the micro-controller. An assembly language is used for this type of programming. Programming in an assembly language is a classic example where the program is always specific to one micro-controller, hard to understand, hard to remember and the worst part is the non-portability. That means if you decide to jump to another micro-controller you will have to start your programming all over again. And don’t forget the efforts you will need to learn that another micro-controller’s assembly language. Because each micro-controller family has it’s own set of assembly commands or pneumonics as they say.
This is where high level programming language kicks in to save our time and efforts. High level languages are usually independent of hardware. Virtually, you don’t need any knowledge of hardware to do programming in high level language. The most important advantages of high level language includes it’s readability and portability.
‘C’ is the most popular programming language used till date, it is not low level, it is not high level but a mid level language where you enjoy benefits of both high level and low level programming. Now you may ask what advantage does the low level language brings despite being non-portable, highly unreadable and controller specific; it has got one great advantage, the SPEED of execution!. Yes. Out of all options that you may imagine, coding in assembly gives you the most efficient code plus speedy execution. This where ‘C’ language shines in bright colors. It gives you readability and portability of high level language plus you can insert assembly level instructions right within your ‘C’ program gaining direct access to micro-controller resources. This is highly useful feature when there is a time critical task at hand.
Now imagine that you have got a set of ‘C’, ‘C++’ functions which are simplified enough to make you understand the functionality just by looking at the name of function. This is nothing but Arduino language. Officially, the Arduino language is merely a set of C/C++ functions that can be called from your code. Your sketch undergoes minor changes (e.g. automatic generation of function prototypes) and then is passed directly to a C/C++ compiler (avr-g++). All standard C and C++ constructs supported by avr-g++ should work in Arduino.
To communicate with your fellow human you must learn the language they speak. Similarly, to communicate with your Arduino board you must learn the Arduino language. Following Language Reference is a brief introduction to the basics of Arduino language. I will suggest you try and experiment with numerous Arduino project ideas that are readily available on the internet. “You can’t learn swimming without getting into water”. The same principle applies here. Don’t worry, you will learn, grow and mature as long as you keep going on this learning path.
Arduino programming language can be divided in three main parts: functions, values (variables and constants), and structure.
For controlling the Arduino board and performing computations.
Zero, Due & MKR Family
Bits and Bytes
Arduino data types and constants.
Variable Scope & Qualifiers
The elements of Arduino (C++) code.
Pointer Access Operators
What are Arduino libraries?
The Arduino environment can be extended through the use of libraries, just like most programming platforms. Libraries provide extra functionality for use in sketches, e.g. working with hardware or manipulating data. To use a library in a sketch, select it from Sketch > Import Library.
A number of libraries come installed with the IDE, but you can also download or create your own. See these instructionsfor details on installing libraries. There’s also a tutorial on writing your own libraries. See the API Style Guide for information on making a good Arduino-style API for your library.
- EEPROM– reading and writing to “permanent” storage
- Ethernet / Ethernet 2– for connecting to the internet using the Arduino Ethernet Shield, Arduino Ethernet Shield 2 and Arduino Leonardo ETH
- Firmata– for communicating with applications on the computer using a standard serial protocol.
- GSM– for connecting to a GSM/GRPS network with the GSM shield.
- LiquidCrystal– for controlling liquid crystal displays (LCDs)
- SD– for reading and writing SD cards
- Servo– for controlling servo motors
- SPI– for communicating with devices using the Serial Peripheral Interface (SPI) Bus
- SoftwareSerial– for serial communication on any digital pins. Version 1.0 and later of Arduino incorporate Mikal Hart‘s NewSoftSerial library as SoftwareSerial.
- Stepper– for controlling stepper motors
- TFT– for drawing text , images, and shapes on the Arduino TFT screen
- WiFi– for connecting to the internet using the Arduino WiFi shield
- Wire– Two Wire Interface (TWI/I2C) for sending and receiving data over a net of devices or sensors.
The Matrix and Sprite libraries are no longer part of the core distribution.
101 Only Libraries
- CurieBLE– Interact with smartphones and tablets with Bluetooth Low Energy (BLE).
- CurieIMU– Manage the on-board accelerometer and gyro.
- CurieTimerOne– Allows to use Timer functions.
- CurieTime– Allows to control and use the internal RTC (Real Time Clock)
Due Only Libraries
- Audio– Play audio files from a SD card.
Due, Zero and MKR1000 Libraries
- USBHost– Communicate with USB peripherals like mice and keyboards.
- Scheduler– Manage multiple non-blocking tasks.
Zero, MKRZERO and MKR1000 Libraries
- AudioFrequencyMeter– Sample an audio signal and get its frequency back
- AudioZero– Play audio files from a SD card
- RTC– Real Time Clock to schedule events
- ArduinoSound– A simple way to play and analyze audio data
- I2S– To use the I2S protocol on SAMD21
WiFi 101 and MKR1000 Library
MKRFOX1200 only Library
- SigFox– library to be used only with MKRFOX1200
Esplora Only Library
- Esplora– this library enable you to easily access to various sensors and actuators mounted on the Esplora board.
Arduino Robot Library
- Robot– this library enables easy access to the functions of the Arduino Robot.
Yún devices Library
- Bridge Library– Enables communication between the Linux processor and the microcontroller on the Yún.
- Ciao Library– Aims to simplify interaction between microcontroller and Linino OS allowing a variety of connections with most common protocols
USB Libraries (Leonardo, Micro, Due, Zero and Esplora)
- Keyboard– Send keystrokes to an attached computer.
- Mouse– Control cursor movement on a connected computer.
Communication (networking and protocols):
- Messenger– for processing text-based messages from the computer
- NewSoftSerial– an improved version of the SoftwareSerial library
- OneWire– control devices (from Dallas Semiconductor) that use the One Wire protocol.
- PS2Keyboard– read characters from a PS2 keyboard.
- Simple Message System– send messages between Arduino and the computer
- SSerial2Mobile– send text messages or emails using a cell phone (via AT commands over software serial)
- Webduino– extensible web server library (for use with the Arduino Ethernet Shield)
- X10– Sending X10 signals over AC power lines
- XBee– for communicating with XBees in API mode
- SerialControl– Remote control other Arduinos over a serial connection
- Capacitive Sensing– turn two or more pins into capacitive sensors
- Debounce– for reading noisy digital inputs (e.g. from buttons)
Displays and LEDs
- GFX– base class with standard graphics routines (by Adafruit Industries)
- GLCD– graphics routines for LCD based on the KS0108 or equivalent chipset.
- Improved LCD libraryfixes LCD initialization bugs in official Arduino LCD library
- LedControl– for controlling LED matrices or seven-segment displays with a MAX7221 or MAX7219.
- LedControl– an alternative to the Matrix library for driving multiple LEDs with Maxim chips.
- LedDisplay– control of a HCMS-29xx scrolling LED display.
- Matrix– Basic LED Matrix display manipulation library
- PCD8544– for the LCD controller on Nokia 55100-like displays (by Adafruit Industries)
- Sprite– Basic image sprite manipulation library for use in animations with an LED matrix
- ST7735– for the LCD controller on a 1.8″, 128×160 TFT screen (by Adafruit Industries)
Audio and Waveforms
- FFT– frequency analysis of audio or other analog signals
- Tone– generate audio frequency square waves in the background on any microcontroller pin
Motors and PWM
- TLC5940– 16 channel 12 bit PWM controller.
- DateTime– a library for keeping track of the current date and time in software.
- Metro– help you time actions at regular intervals
- MsTimer2– uses the timer 2 interrupt to trigger an action every N milliseconds.
- PString– a lightweight class for printing to buffers
- Streaming– a method to simplify print statements
Glossary is nothing but a small dictionary of different words that you may come across during your Arduino learning and development journey.
Analog REFerence : the reference max voltage for the Analog to Digital converter. Changing the AREF allows to use the resolution of the ADC at its best, especially for low voltages. Usually AREF can’t be greater than the supply voltage of the ADC circuit.
The SAM W25 module is based on Atmel’s WINC1500 Wi-Fi core combined with Atmel’s ARM® Cortex® -M0+ based microcontroller technology. It allows to build low power solutions for Internet of Things.
A sensor that measures acceleration. Sometimes, they are used to detect orientation, or tilt.
A WiFi device that connects to the physical network and allows to access the LAN through the wireless connection. Usually it takes care of the authentication and the assignment of an IP address.
A type of component that changes an energy into motion. Motors are a type of electrical actuator.
A type of current where electricity changes its direction periodically. This is the sort of electricity that comes out of a wall socket.
Amperage (Amps or Amperes)
The amount of electrical charge flowing past a specific point in your circuit. Describes the current as it flows through a conductor, like a wire.
Something that can continuously vary over time.
Analog-to-Digital Converter (ADC)
A circuit that converts an analog voltage into a digital number representing that voltage. This circuit is built-in to the microcontroller, and is connected to the analog input pins of the Arduino board.
The positive end of a diode (remember that an LED is a type of diode).
A type of data supplied to a function as an input. For example, for digitalRead() to know what pin to check, it takes an argument in the form of a pin number.
In programming, this is a group of variables that are identified by one name, and accessed by an index number.
Voltage that pushes back against the current that created it. It can be created by motors spinning down. This can damage circuits, which is why diodes are often used in conjunction with motors (Free-wheel diode).
Shorthand for “bits per second”, signifying the speed at which two devices are communicating.
Only two states are possible, like true/false or off/on.
The smallest piece of information a digital device can manage.
A datatype that indicates something binary.
The Bootloader is a special piece of code that the microcontroller executes at power-up or under specific conditions and takes care of the loading of the code into Flash memory. If the Bootloader doesn’t receive an upload request by the host, it passes the execution to the user sketch.
The process of making adjustments to certain numbers or components to get the best results from a circuit or program. In Arduino projects, this is often used when sensors in the real world may give different values in different circumstances, for instance the amount of light on a photoresistor. Calibration can be automatic or manual.
The ability of a material to hold an electrical charge.
The negative end of a diode.
A circular path from a power supply, through a load, and then back again to the other end of the power supply. Current flows in a circuit only if it is closed, that is, if the outgoing and return path are both uninterrupted (or closed). If either path is interrupted (or open) then current will not flow through the circuit.
Common cathode LED
Types of LEDs that have multiple colors in one fixture, with one cathode and multiple anodes.
A material that allows electricity to flow, like a copper wire.
A named identifier that cannot change its value in a program.
CryptoChip it’s an hardware chip that take care of all the calculations required by the modern cryptographic standards. They work with any MCU, are extremely cost-effective, require only a single GPIO, and use very little power. Advanced protocols like ECDSA sign-verify (asymmetric authentication) and ECDH (key agreement in encryption/decryption settings) are built-in which makes adding sophisticated security easy.
The flow of electrical charge through a closed circuit. Measured in Amps.
A Digital to Analog Converter is a circuit that converts a digital value into an analog voltage. It is used in fields like audio and music to create sounds from digital values. The bit resolution of a DAC expresses its capacity of approximating values with precision. Higer resolution means better approximation.
Direct Memory Access is a technology that allows peripherals to access directly areas of the memory without CPU intervention. This increases the throughput of some transfers on interfaces like SPI or DAC.
A techinical document that describes the functionality of a component. Typical information in a datasheet includes the maximum voltage and current a component requires, as well as an explanation of the functionality of the pins.
A classification system that determines what values a particular constant, variable, or array will hold. Int, float, long and boolean are all types that can be used in the Arduino Software (IDE).
The process of going through a circuit or code, and finding errors (also referred as “bugs”), until the expected behavior is achieved.
Capacitors that are used to regulate spikes and dips in voltage and current, often placed close to the circuit they are referred.
A system that deals with discrete values.
A type of current which always flows in the same direction.
The pin of a Field Effect Transistor connected to the higher (n channel) or lower (p channel) voltage of i.e load to be controlled.
Dual In-line Package (DIP)
A type of packaging for integrated circuits
A ratio indicating the amount of time over a certain period that a component is turned on. When using a PWM value of 127 (out of a total of 256), you have a 50% duty cycle.
The Atmel Embedded Debugger (EDBG) it’s a chip that implements a composite USB device. Consisting of three interfaces:
An Electrically Erasable Programmable Reading Only Memory is a type of memory that retains its data without power, like a Read Only Memory, and that can be erased and written. The amount of memory of an EEPROM is usually of thousands of bytes and it is used to retain some data on microcontrollers between power cycles.
A form of energy which we use to power machines and electrical devices.
The Firmware is similar to Software, but it is stored on non volatile memory and can be executed in place – without being copied in RAM – by a microcontroller. It is used in embedded systems and it is made of machine code instructions. Firmware is usually updateable.
This type of memory is non volatile and it is an evolution of EEPROM. It is electrically erasable. Made with different technologies that offer different speeds and capacities (ML, SL, NAND, NOR), Flash Memory is used inside SD and microSD cards, inside mobile phones and also as program memory in microcontrollers.
A datatype used to represent a fraction. This entails the use of decimal points for floating point numbers.
A block of code that executes a specific task.
The pin of a Field Effect Transistor that allows to create a conducting channel between Drain and Source if correctly driven.
A named variable that can be accessed anywhere inside your program. It is declared before the setup() function.
The point of a circuit where there is 0 potential electrical energy. Without a ground, electricity will not have a place to flow in a circuit.
I2C – Inter Integrated Circuit – is two wires serial synchronous bus that provides communication between two Integrated Circuits., introduced in 1982 by Philips Semiconductor. The I2C can run at different speed: 100 Kbps, 400Kbps and 3.4 Mbps. It’s used to connect also different boards with the simplicity of wiring only two cables, called SDA (Data line), SCL (Clock line). Can support up to 1008 slave devices.
In-Circuit Serial Programming is the ability of a microcontroller to be programmed directly on the board on which it is monuted. It is also a set of signals and pins used for the programming.
Stands for “Integrated Development Environment”. The Arduino IDE for example, is the place where you write software to upload to an Arduino bard.
The number supplied to an array that indicates which element you’re referring to. Computers are zero-indexed, which means they start counting at 0 instead of 1. To access the third element in an array named tones, for example, you would write tones.
The production of an electromotive force across a conductor when it is exposed to a time varying magnetic field.
A copy of a software object.
A material that prevents electricity to flow.
A datatype that holds a whole number between -32,768 and 32,767.
Integrated Circuit (IC)
A complex circuit of nano or micro scale with a given package used for a specific purpose.
One of the most recent technologies for rechargeable batteries. This Lithium – Polimer technology offers a very good ratio between capacity and weight, no memory effect and low self discharge rate. Li-Po batteries are charged at constant current.
Its a software extension of the Arduino API that expands the functionality of a program.
An electrical component or portion of a circuit that consumes electric power to turn it into something else.
A type of variable that lives only in the scope in which it is declared and then forgotten. A variable declared inside the setup() of a program would be local: after the setup() finished running, the Galileo would forget that the variable ever existed.
A datatype that can hold a number, from -2,147,483,648 to 2,147,483,647.
The brains of the Arduino, this is a small computer that you will program to listen for, process, and display information.
1/1,000th of a second.
A time syncronization protocol, based on a client-server architecture, available on Internet on UDP port 123. It uses the UTC format and it is unrelated to time zones. When used it allows to syncronize clocks within 10 milliseconds of margin and around 200 microseconds of accuracy inside a LAN.
An instance of a library; e.g. when using the Servo library, were you to create an instance named myServo, myServo would be the object.
Unit of measurement of resistance. Represented by the omega symbol.
A mathematical equation that demonstrates the relationship between resistance, current and voltage. Usually stated as V (voltage) = I (current) x R (resistance).
Also known as an opto-isolator, photo-coupler, photo-isolator, photo-switch, and opto-switch. An LED is combined in a sealed case with a phototransistor. The LED is positioned to illuminate the phototransistor, so that when the LED is turned on, the phototransistor will conduct. Used to provide a high degree of isolation as there is no electrical connection common to the input and the output.
Components connected across the same two points in a circuit are in parallel. Parallel components always have the same voltage drop across them.
When declaring a function, a named parameter serves as the bridge between the local variables in the function, and the arguments it receives when the function is called.
A specific span of time in which something happens. When the period changes, you’re adjusting the frequency at which something will occur.
A device for converting light to voltage or current.
A resistive device whose resistance varies according to how much light hits it.
A transistor whose conduction state is controlled by light.
The leads of polarized components (e.g. LEDs or capacitors) have different functions, and thus must be connected the right way. Polarized components connected the wrong way might not work, might be damaged, or might damage other parts of your circuit. Non-polarized components (e.g. resistors) can be connected either way.
A source of energy, usually a battery, transformer, or even the USB port of your computer. Comes in many varieties such as regulated or unregulated, AC or DC. Usually the voltage is specified, along with the maximum current the supply can deliver before failing.
A programming environment based on the Java language. Used as a tool to introduce people to the concepts of programming, and in production environments. The Arduino IDE is written in Processing, and so will look very familiar. In addition, Processing, Arduino and Galileo share a similar philosophy and motive, of creating free open source tools allowing non-technical people to work with hardware and software.
A bridge between writing in a computer programming language and using natural speech. When creating pseudocode, it’s helpful to write in short declarative statements.
Pulse Width Modulation (PWM)
A way to simulate a varying static voltage.
The Real Time Clock is a circuit that uses either a quartz crystal or a laser trimmed oscillator to keep the time inside a computer or in an embedded system. The circuit has its own power source – usually a lithium battery – and has a very low power consumption. Once set, the RTC can be queried to get date and time throug serial interfaces like I2C.
A measure of how efficiently a material will conduct electricity. In particular, resistance can be calculated by Ohm’s Law as: R = V/I.
A microcontroller of the Atmel’s SAM D family. A rich set of peripherals, flexibility and ease-of-use combined with low power consumption make this microcontroller, based on Cortex-M0+, ideal for a wide range of home automation, consumer, metering and industrial applications.
This term is the combination of SERial and COMmunication. It is used in microcontrollers jargon to indicate a specific type of functional module inside the device. A SERCOM module can be programmed to become a USART, a SPI or an I2C serial port. Each microcontroller may have more tha one SERCOM.
An algorythm developed to check the integrity of data. SHA-256 is Secure Hash Algorithm with 256 bit digest. It is part of the SHA-2 family of hashing algorithms. Cryptographic hash functions are mathematical operations run on digital data; by comparing the computed “hash” (the output from execution of the algorithm) to a known and expected hash value, a person can determine the data’s integrity.
Serial Peripheral Interface is a synchronous serial communication technology that uses four wires and a master/slave architecture. A master device can communicate in full duplex with several slaves using a specific Slave Select signal for each slave. The communication is suitable for short distance, like the inside of the cabimet of an electronic device.
A specific type of memory, Static RAM, that doen’t require the refresh mechanism, typical of the more common DRAM – Dynamic RAM – used in PCs. SRAM keeps the stored data as long as the power supply is kept, offers good access time and low power consumption.
The Service Set IDentifier is the name with which a wireless network identifies itself. Several Access Point may share the same SSID if they are connected to the same LAN. An Access Point may broadcast more than one SSID or none at all.
A component that measures one form of energy (like light or heat or mechanical energy) and converts it to voltage or current.
A place in your computer’s and microcontroller’s memory where information received in serial communication is stored until it is read by a program.
A type of serial protocol between two devices.
A tool built in to the Arduino IDE allowing sending and receiving serial data to and from a connected board.
Components are in series when current flows from the first into the next. The current flowing through both is the same, and the voltage drops across each component.
A short circuit between power and ground will make your circuit stop working and thus should be avoided. In some cases this might damage your power supply or parts of your circuit, and rare cases might start a fire.
The term given to programs written in the Arduino IDE.
System on Chip is an evolution of embedded systems, where in a single package and substrate are hosted all the parts necessary to create a fully functional computer. The package contains a microprocessor, the various types of memory, interfaces for communication and peripheral management, converters and so on. With a SoC is possible to build a very cost effective computer that runs an operating system like Linux and connects to the usual set of I/O peripherals (mouse, keyboard, monitor… ).
The process of making an electrical connection by melting solder over electrical components or wires that are to be connected. This provides a solid connection between components.
The pin of a Field Effect Transistor connected to the lower (n channel) or higher (p channel) voltage of i.e load to be controlled.
A type of waveform that is identified by having only two states, on and off. When used to generate tones, they can sound “buzzy”.
A component that can open or close an electrical circuit.
A type of electronic logic circuitry that works with 5V/0V logic levels. Transistor-Transistor Logic was developed during the sixties of the last century and became a worldwide standard. Low power and low voltage applications are now replacing 5V TTL with new technologies.
A toolchain is a set of programming tools that is used to perform a complex set of operations. In the Arduino Software (IDE) the toolchain is hidden from the user, but it is used to compile and upload the user Sketch. It includes compiler, assembler, linker and Standard C & math libraries.
Something that changes one form of energy into another, Sensors or actuators can be called tranducers. Transducers are device that can perform an input (Sensors) or an output (Actuators) function. For example a force sensor converts the physical change into an electrical signal, an actuator transforms an electrical signal into a physical change like movement or sound. Another example of transducers are the microphone that converts sound waves into electrical signal, or a loudspeaker that converts this electrical signal back into sound waves.
A 3 terminal (usually) electronic device which can act as either an amplifier or a switch. A control voltage or current between two leads controls a (usually) higher voltage or current between a different pair of leads. Common types of transistors include the Bipolar Junction Transistor (BJT) and the Metal Oxide Semiconductor Field Effect Transistor (MOSFET).
An Universal Asynchronous Receiver Transmitter is an hardware device or module inside a microcontroller that implements serial communication with speeds and data format fully configurable.
Stands for Universal Serial Bus. It’s a generic port that is standard on most computers today. With a USB cable, it’s possible to program and power an Arduino over a USB connection.
A term used to describe a datatypes, indicating that they cannot be a negative number. It’s helpful to have an unsigned number if you only need to count in one direction. For instance, when keeping track of time with millis(), it’s advisable to use the unsigned long datatype.
This label marks the pin used to supply the positive voltage to a circuit, a device or a board. The other pin, for ground, is usually labelled VSS or GND.
A label used to indicate the input pin for the voltage to the Arduino/Genuino board when it’s using an external power source (as opposed to 5 volts from the USB connection or other regulated power source). You can supply voltage through this pin, or, if supplying voltage via the power jack, access it through this pin.
A datatype that stores values which are likely to change as your program runs. A variable’s type depends on the type of information you want to store, and the maximum size of the information; for example, a byte can store up to 256 different values, but an int can store up t 65,536 different values. Variables can be local to a particular block of code, or global to an entire program. (see Global variable, Local variable).
A type of circuit that provides an output that is a fraction of its input voltage. You are building a voltage divider when you combine a photoresistor with a fixed resistor to provide an analog input. A potentiometer can also be used as a voltage divider.
The WiFi Protected Access is a cyphering protocol to keep the wireless transfer of data safe from easy eavesdropping. WPA and WPA2 are also certification programs that grant the compliance of the devices with the standards.
This was a small effort to put together all the data that you may need for quick reference. The idea behind this article was to get everything compiled together in one article. So this will serve as the ultimate ‘Arduino basics benchmark’ for you. Whenever you are stuck at any term in Arduino or want to find out which function can take your project to next level, you can just come back here to explore the options.
I hope you find this article helpful. Please subscribe for more exciting and knowledgeable articles.
Until next time Adieus! See you in the next one.