gavmac00/arduino-docs huggingface dataset:
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        Find anything that can be improved? Suggest corrections and new documentation via GitHub.
        Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Reference
            >  Libraries
            > Tetrisanimation
          
TetrisAnimation
Display
          Library for drawing text out with tetris blocks
          
          
          Uses the Adafruit GFX library to draw tetris blocks into letters on displays.
          
        
          Author: Tobias Blum, Brian Lough
          Maintainer: Brian Lough
Read the documentation
Compatibility
This library is compatible with all architectures so you should be able to use
          it on all the Arduino
          boards.
Releases
To use this library, open the Library Manager in
          the
          Arduino IDE and install it from there.
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        Find anything that can be improved? Suggest corrections and new documentation via GitHub.
        Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Reference
            >  Libraries
            > Espectro32
          
ESPectro32
Communication
          ESPectro32 development board library for Arduino IDE
          
          
          The library for you to get up fast for using ESPectro32 dev board with Arduino IDE. ESPectro32 is designed by DycodeX, a leading Internet of Things (IoT) and disruptive technology company from Indonesia.
          
        
          Author: Andri Yadi
          Maintainer: DycodeX Team
Read the documentation
Compatibility
This library is compatible with the esp32
          architecture.
          
        Releases
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        Find anything that can be improved? Suggest corrections and new documentation via GitHub.
        Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Reference
            >  Libraries
            > Hactimers
          
HaCTimers
Timing
          An event driven arduino Timer.
          
          
          An event driven Timer for arduino which can be used as Tick Tack, Tick & toggle, Up & Down Counter and Time ON/OFF delay.
          
        
          Author: Harvy Aronales Costiniano
          Maintainer: Harvy Aronales Costiniano
Read the documentation
Compatibility
This library is compatible with the esp8266, esp32
          architectures.
          
        Releases
To use this library, open the Library Manager in
          the
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        Find anything that can be improved? Suggest corrections and new documentation via GitHub.
        Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Reference
            >  Libraries
            > Gst
          
GST
Data Processing
          Arduino library for Golden Standard Test, confusion matrix.
          
          Author: Rob Tillaart
          Maintainer: Rob Tillaart
Read the documentation
Compatibility
This library is compatible with all architectures so you should be able to use
          it on all the Arduino
          boards.
Releases
To use this library, open the Library Manager in
          the
          Arduino IDE and install it from there.
0.1.3
            (latest)
          
0.1.2
0.1.1
0.1.0
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        Find anything that can be improved? Suggest corrections and new documentation via GitHub.
        Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Reference
            >  Libraries
            > Lsm6
          
LSM6
Sensors
          LSM6 accelerometer and gyro library
          
          
          This is a library for the Arduino IDE that helps interface with ST's LSM6DSO and LSM6DS33 accelerometer and gyro ICs.
          
        
          Author: Pololu
          Maintainer: Pololu
Read the documentation
Compatibility
This library is compatible with all architectures so you should be able to use
          it on all the Arduino
          boards.
Releases
To use this library, open the Library Manager in
          the
          Arduino IDE and install it from there.
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        Find anything that can be improved? Suggest corrections and new documentation via GitHub.
        Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Reference
            >  Libraries
            > Afarray
          
AFArray
Other
          Simple Array ADT for Arduino Framework with template.
          
          
          Very useful and smart Array ADT.
          
        
          Author: Andrea Tazio Giusti
          Maintainer: Andrea Tazio Giusti andreatgiusti@gmail.com
Read the documentation
Go to repository
Compatibility
This library is compatible with all architectures so you should be able to use
          it on all the Arduino
          boards.
Releases
To use this library, open the Library Manager in
          the
          Arduino IDE and install it from there.
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        Find anything that can be improved? Suggest corrections and new documentation via GitHub.
        Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Reference
            >  Libraries
            > Tuyav
          
Tuyav
Uncategorized
          Communicate with the Tuya IoT module
          
          
          Communicate with the Tuya IoT module and make your arduino connect to eveything you want
          
        
          Author: Velleman nv
          Maintainer: Velleman nv
Read the documentation
Compatibility
This library is compatible with the avr, megaAVR, megaavr
          architectures so you
          should be able to use it on the
          following Arduino boards:
Arduino Micro
Arduino Leonardo
Arduino Mega
Arduino Nano
Arduino Nano Every
Arduino Uno
Arduino Micro
Arduino Leonardo
Arduino Mega
Arduino Nano
Arduino Nano Every
Arduino Uno
Arduino Uno WiFi REV2
Arduino Yún
Compatibility Note
Note: while the library is supposed to compile correctly on these architectures,
          it might require specific hardware features that may be available only on some boards.
        
Releases
To use this library, open the Library Manager in
          the
          Arduino IDE and install it from there.
1.2.1
            (latest)
          
1.2.0
1.1.0
1.0.0
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        Find anything that can be improved? Suggest corrections and new documentation via GitHub.
        Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Reference
            >  Libraries
            > Ustepper s lite
          
uStepper S-lite
Device Control
          Library offering support for uStepper S-lite
          
          
          uStepper support library
          
        
          Author: uStepper ApS
          Maintainer: Thomas Olsen (thomas@ustepper.com)
Read the documentation
Go to repository
Compatibility
This library is compatible with all architectures so you should be able to use
          it on all the Arduino
          boards.
Releases
To use this library, open the Library Manager in
          the
          Arduino IDE and install it from there.
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        Find anything that can be improved? Suggest corrections and new documentation via GitHub.
        Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Reference
            >  Libraries
            > Usbmidi
          
USBMIDI
Communication
          USB MIDI library for Arduino.
          
          
          Provides USB MIDI functionality via the familiar Serial interface, porting existing code is trivial. Uses PluggableUSB library for devices that support it. Other AVR8 devices are supported by using V-USB library by Object Development (https://www.obdev.at/products/vusb/index.html). Since version 1.1.2, config for Digispark boards was added.
          
        
          Author: Blokas
          Maintainer: Giedrius Trainavičius
Read the documentation
Go to repository
Read the documentation
Go to repository
Compatibility
This library is compatible with the avr
          architecture so you
          should be able to use it on the
          following Arduino boards:
Arduino Micro
Arduino Leonardo
Arduino Mega
Arduino Nano
Arduino Uno
Arduino Yún
Compatibility Note
Note: while the library is supposed to compile correctly on these architectures,
          it might require specific hardware features that may be available only on some boards.
        
Releases
To use this library, open the Library Manager in
          the
          Arduino IDE and install it from there.
1.1.6
            (latest)
          
1.1.5
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        Find anything that can be improved? Suggest corrections and new documentation via GitHub.
        Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Reference
            >  Libraries
            > Multi oled
          
Multi_OLED
Display
          Control multiple I2C OLED displays.
          
          
          Supports a combination of multiple bit-banged buses and addresses to handle any number of displays.
          
        
          Author: Larry Bank
          Maintainer: Larry Bank
Read the documentation
Compatibility
This library is compatible with all architectures so you should be able to use
          it on all the Arduino
          boards.
Releases
To use this library, open the Library Manager in
          the
          Arduino IDE and install it from there.
1.0.0
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        Find anything that can be improved? Suggest corrections and new documentation via GitHub.
        Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Reference
            >  Libraries
            > Dfrobot mcp4725
          
DFRobot_MCP4725
Sensors
          12 bit digital-analog DA conversion module(SKU: DFR0552).
          
          
          This is a 12 bit digital-analog DA conversion module, I2C interface is easy to use and can output different waveforms.
          
        
          Author: DFRobot
          Maintainer: wxzed(xiao.wu@dfrobot.com),tangjie(jie.tang@dfrobot.com)
Read the documentation
Compatibility
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        Find anything that can be improved? Suggest corrections and new documentation via GitHub.
        Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Reference
            >  Libraries
            > Esp dash
          
ESP-DASH
Communication
          A blazing fast library to create realtime dashboards for ESP8266's and ESP32's.
          
          
          ESP-DASH lets you create functional and beautiful dashboards for your ESP8266 / ESP32 without the need of an internet connection.
          
        
          Author: Ayush Sharma
          Maintainer: Ayush Sharma
Read the documentation
Compatibility
This library is compatible with the esp8266, esp32
          architectures.
          
        Releases
To use this library, open the Library Manager in
          the
Releases
To use this library, open the Library Manager in
          the
          Arduino IDE and install it from there.
4.0.1
            (latest)
          
4.0.0
3.0.8
3.0.7
3.0.6
3.0.5
3.0.4
3.0.3
3.0.2
3.0.0
2.2.5
2.2.4
2.2.2
2.2.1
2.2.0
2.1.5
2.1.4
2.0.4
2.0.3
2.0.2
2.0.0
1.0.3
1.0.0
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        Find anything that can be improved? Suggest corrections and new documentation via GitHub.
        Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Reference
            >  Libraries
            > Sodaq bmp085
          
Sodaq_BMP085
Sensors
          An Arduino library for the BMP085/BMP180 Barometric Pressure + Temp sensor
          
          Author: keestux,SODAQ
          Maintainer: Kees Bakker
Read the documentation
Compatibility
This library is compatible with all architectures so you should be able to use
          it on all the Arduino
          boards.
Releases
To use this library, open the Library Manager in
          the
          Arduino IDE and install it from there.
1.4.0
            (latest)
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        The Arduino Reference text is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
    
    Find anything that can be improved? Suggest corrections and new documentation via GitHub.
    Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Last Revision: Searching...
Last Build: 2023/06/30 
Edit This Page
Reference
            >  Language
            >  Structure
            >  Further syntax
            > Include
          
#include
          [Further Syntax]
          
Description
#include is used to include outside libraries in your sketch. This gives the programmer access to a large group of standard C libraries (groups of pre-made functions), and also libraries written especially for Arduino.
The main reference page for AVR C libraries (AVR is a reference to the Atmel chips on which the Arduino is based) is here.
Note that #include, similar to #define, has no semicolon terminator, and the compiler will yield cryptic error messages if you add one.
Syntax
#include <LibraryFile.h>
#include "LocalFile.h"
Parameters
LibraryFile.h: when the angle brackets syntax is used, the libraries paths will be searched for the file.
LocalFile.h: When the double quotes syntax is used, the folder of the file using the #include directive will be searched for the specified file, then the libraries paths if it was not found in the local path. Use this syntax for header files in the sketch’s folder.
Example Code
This example includes the Servo library so that its functions may be used to control a Servo motor.
#include <Servo.h>
#include <Servo.h>
Servo myservo;  // create servo object to control a servo
void setup() {
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
}
void loop() {
  for (int pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
    // in steps of 1 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
  for (int pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        The Arduino Reference text is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
    
    Find anything that can be improved? Suggest corrections and new documentation via GitHub.
    Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Last Revision: Searching...
Last Build: 2023/06/30 
Edit This Page
Reference
            >  Language
            >  Structure
            >  Further syntax
            > Define
          
#define
          [Further Syntax]
          
Description
> Define
          
#define
          [Further Syntax]
          
Description
#define is a useful C++ component that allows the programmer to give a name to a constant value before the program is compiled. Defined constants in arduino don’t take up any program memory space on the chip. The compiler will replace references to these constants with the defined value at compile time.
This can have some unwanted side effects though, if for example, a constant name that had been #defined is included in some other constant or variable name. In that case the text would be replaced by the #defined number (or text).
In general, the const keyword is preferred for defining constants and should be used instead of #define.
Syntax
#define constantName value
Parameters
constantName: the name of the macro to define.
value: the value to assign to the macro.
Example Code
#define ledPin 3
value: the value to assign to the macro.
Example Code
#define ledPin 3
// The compiler will replace any mention of ledPin with the value 3 at compile time.
Notes and Warnings
There is no semicolon after the #define statement. If you include one, the compiler will throw cryptic errors further down the page.
#define ledPin 3; // this is an error
Similarly, including an equal sign after the #define statement will also generate a cryptic compiler error further down the page.
#define ledPin  = 3 // this is also an error
See also
LANGUAGE const
LANGUAGE Constants
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        The Arduino Reference text is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
    
    Find anything that can be improved? Suggest corrections and new documentation via GitHub.
    Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Last Revision: Searching...
Last Build: 2023/06/30 
Edit This Page
Reference
            >  Language
            >  Structure
            >  Further syntax
            > Blockcomment
          
/* */
          [Further Syntax]
          
Description
> Blockcomment
          
/* */
          [Further Syntax]
          
Description
Comments are lines in the program that are used to inform yourself or others about the way the program works. They are ignored by the compiler, and not exported to the processor, so they don’t take up any space in the microcontroller’s flash memory. Comments' only purpose is to help you understand (or remember), or to inform others about how your program works.
The beginning of a block comment or a multi-line comment is marked by the symbol /* and the symbol */ marks its end. This type of comment is called so as this can extend over more than one line; once the compiler reads the /* it ignores whatever follows until it encounters a */.
Example Code
/* This is a valid comment */
/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
  This example code is in the public domain.
This example code is in the public domain.
  (Another valid comment)
*/
/*
  if (gwb == 0) { // single line comment is OK inside a multi-line comment
    x = 3;          /* but not another multi-line comment - this is invalid */
  }
// don't forget the "closing" comment - they have to be balanced!
*/
Notes and Warnings
When experimenting with code, "commenting out" parts of your program is a convenient way to remove lines that may be buggy. This leaves the lines in the code, but turns them into comments, so the compiler just ignores them. This can be especially useful when trying to locate a problem, or when a program refuses to compile and the compiler error is cryptic or unhelpful.
See also
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        The Arduino Reference text is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
    
    Find anything that can be improved? Suggest corrections and new documentation via GitHub.
    Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Last Revision: Searching...
Last Build: 2023/06/30 
Edit This Page
Reference
            >  Language
            >  Structure
            >  Further syntax
            > Curlybraces
          
{}
          [Further Syntax]
          
Description
Curly braces (also referred to as just "braces" or as "curly brackets") are a major part of the C++ programming language. They are used in several different constructs, outlined below, and this can sometimes be confusing for beginners.
An opening curly brace { must always be followed by a closing curly brace }. This is a condition that is often referred to as the braces being balanced. The Arduino IDE (Integrated Development Environment) includes a convenient feature to check the balance of curly braces. Just select a brace, or even click the insertion point immediately following a brace, and its logical companion will be highlighted.
Beginner programmers, and programmers coming to C++ from the BASIC language often find using braces confusing or daunting. After all, the same curly braces replace the RETURN statement in a subroutine (function), the ENDIF statement in a conditional and the NEXT statement in a FOR loop.
Unbalanced braces can often lead to cryptic, impenetrable compiler errors that can sometimes be hard to track down in a large program. Because of their varied usages, braces are also incredibly important to the syntax of a program and moving a brace one or two lines will often dramatically affect the meaning of a program.
Example Code
Example Code
The main uses of curly braces are listed in the examples below.
Functions
void myfunction(datatype argument) {
  // any statement(s)
}
Loops
while (boolean expression) {
  // any statement(s)
}
do {
  // any statement(s)
} while (boolean expression);
for (initialisation; termination condition; incrementing expr) {
  // any statement(s)
}
Conditional Statements
if (boolean expression) {
  // any statement(s)
}
else if (boolean expression) {
  // any statement(s)
}
else {
  // any statement(s)
}
See also
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        The Arduino Reference text is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
    
    Find anything that can be improved? Suggest corrections and new documentation via GitHub.
    Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Last Revision: Searching...
Last Build: 2023/06/30 
Edit This Page
Reference
            >  Language
            >  Structure
            >  Further syntax
            > Semicolon
          
;
          [Further Syntax]
          
Description
Used to end a statement.
Example Code
int a = 13;
Notes and Warnings
Example Code
int a = 13;
Notes and Warnings
Forgetting to end a line in a semicolon will result in a compiler error. The error text may be obvious, and refer to a missing semicolon, or it may not. If an impenetrable or seemingly illogical compiler error comes up, one of the first things to check is a missing semicolon, in the immediate vicinity, preceding the line at which the compiler complained.
See also
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        The Arduino Reference text is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
    
    Find anything that can be improved? Suggest corrections and new documentation via GitHub.
    Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Last Revision: Searching...
Last Build: 2023/06/30 
Edit This Page
Reference
            >  Language
            >  Structure
            >  Further syntax
            > Singlelinecomment
          
//
          [Further Syntax]
          
Description
> Singlelinecomment
          
//
          [Further Syntax]
          
Description
Comments are lines in the program that are used to inform yourself or others about the way the program works. They are ignored by the compiler, and not exported to the processor, so they don’t take up any space in the microcontroller’s flash memory. Comments' only purpose is to help you understand (or remember), or to inform others about how your program works.
A single line comment begins with // (two adjacent slashes). This comment ends automatically at the end of a line. Whatever follows // till the end of a line will be ignored by the compiler.
Example Code
There are two different ways of marking a line as a comment:
// pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
// give it a name:
int led = 13;
digitalWrite(led, HIGH);  // turn the LED on (HIGH is the voltage level)
Notes and Warnings
When experimenting with code, "commenting out" parts of your program is a convenient way to remove lines that may be buggy. This leaves the lines in the code, but turns them into comments, so the compiler just ignores them. This can be especially useful when trying to locate a problem, or when a program refuses to compile and the compiler error is cryptic or unhelpful.
See also
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        The Arduino Reference text is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
    
    Find anything that can be improved? Suggest corrections and new documentation via GitHub.
    Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Last Revision: Searching...
Last Build: 2023/06/30 
Edit This Page
Reference
            >  Language
            >  Structure
            >  Comparison operators
            > Lessthanorequalto
          
<=
          [Comparison Operators]
          
Description
<=
          [Comparison Operators]
          
Description
Compares the variable on the left with the value or variable on the right of the operator. Returns true when the operand on the left is less (smaller) than or equal to the operand on the right. Please note that you may compare variables of different data types, but that could generate unpredictable results, it is therefore recommended to compare variables of the same data type including the signed/unsigned type.
Syntax
x ⇐ y; // is true if x is smaller than or equal to y and it is false if x is greater than y
Parameters
x: variable. Allowed data types: int, float, double, byte, short, long.
y: variable or constant. Allowed data types: int, float, double, byte, short, long.
Example Code
if (x <= y) { // tests if x is less (smaller) than or equal to y
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        The Arduino Reference text is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
    
    Find anything that can be improved? Suggest corrections and new documentation via GitHub.
    Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Last Revision: Searching...
Last Build: 2023/06/30 
Edit This Page
Reference
            >  Language
            >  Structure
            >  Comparison operators
            > Lessthan
          
<
          [Comparison Operators]
          
Description
> Lessthan
          
<
          [Comparison Operators]
          
Description
Compares the variable on the left with the value or variable on the right of the operator. Returns true when the operand on the left is less (smaller) than the operand on the right. Please note that you may compare variables of different data types, but that could generate unpredictable results, it is therefore recommended to compare variables of the same data type including the signed/unsigned type.
Syntax
x < y;  // is true if x is smaller than y and it is false if x is equal or bigger than y
Parameters
x: variable. Allowed data types: int, float, double, byte, short, long.
y: variable or constant. Allowed data types: int, float, double, byte, short, long.
Example Code
if (x < y) {  // tests if x is less (smaller) than y
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        The Arduino Reference text is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
    
    Find anything that can be improved? Suggest corrections and new documentation via GitHub.
    Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Last Revision: Searching...
Last Build: 2023/06/30 
Edit This Page
Reference
            >  Language
            >  Structure
            >  Comparison operators
            > Equalto
          
==
          [Comparison Operators]
          
Description
> Equalto
          
==
          [Comparison Operators]
          
Description
Compares the variable on the left with the value or variable on the right of the operator. Returns true when the two operands are equal. Please note that you may compare variables of different data types, but that could generate unpredictable results, it is therefore recommended to compare variables of the same data type including the signed/unsigned type.
Syntax
x == y; // is true if x is equal to y and it is false if x is not equal to y
Parameters
x: variable. Allowed data types: int, float, double, byte, short, long.
y: variable or constant. Allowed data types: int, float, double, byte, short, long.
Example Code
if (x == y) { // tests if x is equal to y
  // do something only if the comparison result is true
}
See also
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        The Arduino Reference text is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
    
    Find anything that can be improved? Suggest corrections and new documentation via GitHub.
    Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Last Revision: Searching...
Last Build: 2023/06/30 
Edit This Page
Reference
            >  Language
            >  Structure
            >  Comparison operators
            > Greaterthan
          
>
          [Comparison Operators]
          
Description
> Greaterthan
          
>
          [Comparison Operators]
          
Description
Compares the variable on the left with the value or variable on the right of the operator. Returns true when the operand on the left is greater (bigger) than the operand on the right. Please note that you may compare variables of different data types, but that could generate unpredictable results, it is therefore recommended to compare variables of the same data type including the signed/unsigned type.
Syntax
x > y;  // is true if x is bigger than y and it is false if x is equal or smaller than y
Parameters
x: variable. Allowed data types: int, float, double, byte, short, long.
y: variable or constant. Allowed data types: int, float, double, byte, short, long.
Example Code
if (x > y) {  // tests if x is greater (bigger) than y
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        The Arduino Reference text is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
    
    Find anything that can be improved? Suggest corrections and new documentation via GitHub.
    Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Last Revision: Searching...
Last Build: 2023/06/30 
Edit This Page
Reference
            >  Language
            >  Structure
            >  Comparison operators
            > Greaterthanorequalto
          
>=
          [Comparison Operators]
          
Description
>=
          [Comparison Operators]
          
Description
Compares the variable on the left with the value or variable on the right of the operator. Returns true when the operand on the left is greater (bigger) than or equal to the operand on the right. Please note that you may compare variables of different data types, but that could generate unpredictable results, it is therefore recommended to compare variables of the same data type including the signed/unsigned type.
Syntax
x >= y; // is true if x is bigger than or equal to y and it is false if x is smaller than y
Parameters
x: variable. Allowed data types: int, float, double, byte, short, long.
y: variable or constant. Allowed data types: int, float, double, byte, short, long.
Example Code
if (x >= y) { // tests if x is greater (bigger) than or equal to y
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        The Arduino Reference text is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
    
    Find anything that can be improved? Suggest corrections and new documentation via GitHub.
    Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Last Revision: Searching...
Last Build: 2023/06/30 
Edit This Page
Reference
            >  Language
            >  Structure
            >  Comparison operators
            > Notequalto
          
!=
          [Comparison Operators]
          
Description
> Notequalto
          
!=
          [Comparison Operators]
          
Description
Compares the variable on the left with the value or variable on the right of the operator. Returns true when the two operands are not equal. Please note that you may compare variables of different data types, but that could generate unpredictable results, it is therefore recommended to compare variables of the same data type including the signed/unsigned type.
Syntax
x != y; // is false if x is equal to y and it is true if x is not equal to y
Parameters
x: variable. Allowed data types: int, float, double, byte, short, long.
y: variable or constant. Allowed data types: int, float, double, byte, short, long.
Example Code
if (x != y) { // tests if x is not equal to y
  // do something only if the comparison result is true
}
See also
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        The Arduino Reference text is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
    
    Find anything that can be improved? Suggest corrections and new documentation via GitHub.
    Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Last Revision: Searching...
Last Build: 2023/06/30 
Edit This Page
Reference
            >  Language
            >  Structure
            >  Pointer access operators
            > Dereference
          
*
          [Pointer Access Operators]
          
Description
Dereferencing is one of the features specifically for use with pointers. The asterisk operator * is used for this purpose. If p is a pointer, then *p represents the value contained in the address pointed by p.
Example Code
Example Code
int *p;       // declare a pointer to an int data type
int i = 5;
int result = 0;
p = &i;       // now 'p' contains the address of 'i'
result = *p;  // 'result' gets the value at the address pointed by 'p'
              // i.e., it gets the value of 'i' which is 5
Notes and Warnings
Pointers are one of the complicated subjects for beginners in learning C, and it is possible to write the vast majority of Arduino sketches without ever encountering pointers. However for manipulating certain data structures, the use of pointers can simplify the code, and knowledge of manipulating pointers is handy to have in one’s toolkit.
See also
DEFINITION Pointers
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        The Arduino Reference text is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
    
    Find anything that can be improved? Suggest corrections and new documentation via GitHub.
    Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Last Revision: Searching...
Last Build: 2023/06/30 
Edit This Page
Reference
            >  Language
            >  Structure
            >  Pointer access operators
            > Reference
          
&
          [Pointer Access Operators]
          
Description
Referencing is one of the features specifically for use with pointers. The ampersand operator & is used for this purpose. If x is a variable, then &x represents the address of the variable x.
Example Code
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        The Arduino Reference text is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
    
    Find anything that can be improved? Suggest corrections and new documentation via GitHub.
    Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Last Revision: Searching...
Last Build: 2023/06/30 
Edit This Page
Reference
            >  Language
            >  Structure
            >  Compound operators
            > Compounddivision
          
/=
          [Compound Operators]
          
Description
This is a convenient shorthand to perform division of a variable with another constant or variable.
Syntax
x /= y; // equivalent to the expression x = x / y;
Parameters
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        The Arduino Reference text is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
    
    Find anything that can be improved? Suggest corrections and new documentation via GitHub.
    Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Last Revision: Searching...
Last Build: 2023/06/30 
Edit This Page
Reference
            >  Language
            >  Structure
            >  Compound operators
            > Compoundmultiplication
          
*=
          [Compound Operators]
          
Description
This is a convenient shorthand to perform multiplication of a variable with another constant or variable.
Syntax
x *= y; // equivalent to the expression x = x * y;
Parameters
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        The Arduino Reference text is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
    
    Find anything that can be improved? Suggest corrections and new documentation via GitHub.
    Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Last Revision: Searching...
Last Build: 2023/06/30 
Edit This Page
Reference
            >  Language
            >  Structure
            >  Compound operators
            > Compoundremainder
          
%=
          [Compound Operators]
          
Description
This is a convenient shorthand to calculate the remainder when one integer is divided by another and assign it back to the variable the calculation was done on.
Syntax
x %= divisor;   // equivalent to the expression x = x % divisor;
Parameters
x %= divisor;   // equivalent to the expression x = x % divisor;
Parameters
x: variable. Allowed data types: int.
divisor: non zero variable or constant. Allowed data types: int.
Example Code
int x = 7;
x %= 5;    // x now contains 2
Notes and Warnings
The compound remainder operator does not work on floats.
If the first operand is negative, the result is negative (or zero).
Therefore, the result of x %= 10 will not always be between 0 and 9 if x can be negative.
See also
LANGUAGE Remainder
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        The Arduino Reference text is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
    
    Find anything that can be improved? Suggest corrections and new documentation via GitHub.
    Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Last Revision: Searching...
Last Build: 2023/06/30 
Edit This Page
Reference
            >  Language
            >  Structure
            >  Compound operators
            > Compoundbitwiseor
          
|=
          [Compound Operators]
          
Description
The compound bitwise OR operator |= is often used with a variable and a constant to "set" (set to 1) particular bits in a variable.
A review of the Bitwise OR | operator:
A review of the Bitwise OR | operator:
0  0  1  1    operand1
0  1  0  1    operand2
----------
0  1  1  1    (operand1 | operand2) - returned result
Syntax
x |= y; // equivalent to x = x | y;
Parameters
x: variable. Allowed data types: char, int, long.
y: variable or constant. Allowed data types: char, int, long.
Example Code
Bits that are "bitwise ORed" with 0 are unchanged, so if myByte is a byte variable,
myByte | 0b00000000 = myByte;
Bits that are "bitwise ORed" with 1 are set to 1 so:
myByte | 0b11111111 = 0b11111111;
Notes and Warnings
Notes and Warnings
Because we are dealing with bits in a bitwise operator - it is convenient to use the binary formatter with constants. The numbers are still the same value in other representations, they are just not as easy to understand. Also, 0b00000000 is shown for clarity, but zero in any number format is zero.
Consequently - to set bits 0 & 1 of a variable, while leaving the rest of the variable unchanged, use the compound bitwise OR operator (|=) with the constant 0b00000011
1  0  1  0  1  0  1  0    variable
0  0  0  0  0  0  1  1    mask
----------------------
1  0  1  0  1  0  1  1
bits unchanged
                 bits set
bits unchanged
                 bits set
Here is the same representation with the variables bits replaced with the symbol x
x  x  x  x  x  x  x  x    variable
0  0  0  0  0  0  1  1    mask
----------------------
x  x  x  x  x  x  1  1
bits unchanged
                 bits set
So if:
myByte = 0b10101010;
myByte |= 0b00000011 == 0b10101011;
See also
LANGUAGE | Bitwise OR
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        The Arduino Reference text is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
    
    Find anything that can be improved? Suggest corrections and new documentation via GitHub.
    Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Last Revision: Searching...
Last Build: 2023/06/30 
Edit This Page
Reference
            >  Language
            >  Structure
            >  Compound operators
            > Compoundbitwiseand
          
&=
          [Compound Operators]
          
Description
The compound bitwise AND operator &= is often used with a variable and a constant to force particular bits in a variable to the LOW state (to 0). This is often referred to in programming guides as "clearing" or "resetting" bits.
A review of the Bitwise AND & operator:
0  0  1  1    operand1
0  1  0  1    operand2
----------
0  0  0  1    (operand1 & operand2) - returned result
Syntax
x &= y; // equivalent to x = x & y;
Parameters
x: variable. Allowed data types: char, int, long.
y: variable or constant. Allowed data types: char, int, long.
Example Code
Bits that are "bitwise ANDed" with 0 are cleared to 0 so, if myByte is a byte variable,
myByte & 0b00000000 = 0;
Bits that are "bitwise ANDed" with 1 are unchanged so,
myByte & 0b11111111 = myByte;
Notes and Warnings
myByte & 0b11111111 = myByte;
Notes and Warnings
Because we are dealing with bits in a bitwise operator - it is convenient to use the binary formatter with constants. The numbers are still the same value in other representations, they are just not as easy to understand. Also, 0b00000000 is shown for clarity, but zero in any number format is zero (hmmm something philosophical there?)
Consequently - to clear (set to zero) bits 0 & 1 of a variable, while leaving the rest of the variable unchanged, use the compound bitwise AND operator (&=) with the constant 0b11111100
1  0  1  0  1  0  1  0    variable
1  1  1  1  1  1  0  0    mask
----------------------
----------------------
1  0  1  0  1  0  0  0
bits unchanged
                 bits cleared
Here is the same representation with the variable’s bits replaced with the symbol x
x  x  x  x  x  x  x  x    variable
1  1  1  1  1  1  0  0    mask
----------------------
x  x  x  x  x  x  0  0
bits unchanged
                 bits cleared
So if:
myByte = 0b10101010;
myByte &= 0b11111100;  // results in 0b10101000
See also
LANGUAGE & Bitwise AND
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        The Arduino Reference text is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
    
    Find anything that can be improved? Suggest corrections and new documentation via GitHub.
    Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Last Revision: Searching...
Last Build: 2023/06/30 
Edit This Page
Reference
            >  Language
            >  Structure
            >  Compound operators
            > Increment
          
++
          [Compound Operators]
          
Description
Increments the value of a variable by 1.
Syntax
x++;  // increment x by one and returns the old value of x
++x;  // increment x by one and returns the new value of x
Parameters
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        The Arduino Reference text is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
    
    Find anything that can be improved? Suggest corrections and new documentation via GitHub.
    Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Last Revision: Searching...
Last Build: 2023/06/30 
Edit This Page
Reference
            >  Language
            >  Structure
            >  Compound operators
            > Compoundsubtraction
          
-=
          [Compound Operators]
          
Description
This is a convenient shorthand to perform subtraction of a constant or a variable from a variable.
Syntax
x -= y; // equivalent to the expression x = x - y;
Parameters
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        The Arduino Reference text is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
    
    Find anything that can be improved? Suggest corrections and new documentation via GitHub.
    Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Last Revision: Searching...
Last Build: 2023/06/30 
Edit This Page
Reference
            >  Language
            >  Structure
            >  Compound operators
            > Compoundbitwisexor
          
^=
          [Compound Operators]
          
Description
The compound bitwise XOR operator ^= is often used with a variable and a constant to toggle (invert) particular bits in a variable.
A review of the Bitwise XOR ^ operator:
0  0  1  1    operand1
0  0  1  1    operand1
0  1  0  1    operand2
----------
0  1  1  0    (operand1 ^ operand2) - returned result
Syntax
x ^= y; // equivalent to x = x ^ y;
Parameters
x: variable. Allowed data types: char, int, long.
y: variable or constant. Allowed data types: char, int, long.
Example Code
Bits that are "bitwise XORed" with 0 are left unchanged. So if myByte is a byte variable,
myByte ^ 0b00000000 = myByte;
Bits that are "bitwise XORed" with 1 are toggled so:
myByte ^ 0b11111111 = ~myByte;
Notes and Warnings
myByte ^ 0b11111111 = ~myByte;
Notes and Warnings
Because we are dealing with bits in a bitwise operator - it is convenient to use the binary formatter with constants. The numbers are still the same value in other representations, they are just not as easy to understand. Also, 0b00000000 is shown for clarity, but zero in any number format is zero.
Consequently - to toggle bits 0 & 1 of a variable, while leaving the rest of the variable unchanged, use the compound bitwise XOR operator (^=) with the constant 0b00000011
1  0  1  0  1  0  1  0    variable
0  0  0  0  0  0  1  1    mask
----------------------
----------------------
1  0  1  0  1  0  0  1
bits unchanged
                 bits toggled
Here is the same representation with the variables bits replaced with the symbol x. ~x represents the complement of x.
x  x  x  x  x  x  x  x    variable
0  0  0  0  0  0  1  1    mask
----------------------
x  x  x  x  x  x ~x ~x
bits unchanged
                 bits set
So if:
myByte = 0b10101010;
myByte ^= 0b00000011 == 0b10101001;
See also
LANGUAGE ^ Bitwise XOR
Language
functions
variables
structure
Libraries
IoT Cloud API
Glossary
        The Arduino Reference text is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
    
    Find anything that can be improved? Suggest corrections and new documentation via GitHub.
    Doubts on how to use Github? Learn everything you need to know in this tutorial.
    
Last Revision: Searching...
Last Build: 2023/06/30 
Edit This Page
Reference
            >  Language
            >  Structure
            >  Compound operators
            > Decrement
          
--
          [Compound Operators]
          
Description
Decrements the value of a variable by 1.
Syntax
x--;  // decrement x by one and returns the old value of x
--x;  // decrement x by one and returns the new value of x
Parameters