id
stringlengths
14
16
text
stringlengths
10
1.45k
source
stringlengths
46
118
2bfc461c39eb-1
it on all the Arduino boards. Releases To use this library, open the Library Manager in the Arduino IDE and install it from there. 6.0.3 (latest) 6.0.2 6.0.1 6.0.0 5.1.0 5.0.3 5.0.2 5.0.1 5.0.0 2.0.1 2.0.0 1.0.2 1.0.1
https://www.arduino.cc/reference/en/libraries/bolder-flight-systems-ams5915/index.html
515169b522b7-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 > Sram SRAM Data Storage Simple library for serial SRAM IC's Simple library for SPI Static RAM IC's like Microchip 23K256 Author: panStamp Maintainer: panStamp 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. 1.0.1
https://www.arduino.cc/reference/en/libraries/sram/index.html
515169b522b7-1
the Arduino IDE and install it from there. 1.0.1 (latest)
https://www.arduino.cc/reference/en/libraries/sram/index.html
02215148ff3a-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 > Sensor communication library Sensor Communication Library Communication Arduino library for easy sensors data communication This library allow you to send filtered (mobile average) sensors data as a streeam of data in csv format. Author: IoThingsWare Maintainer: Toni Cafiero 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.
https://www.arduino.cc/reference/en/libraries/sensor-communication-library/index.html
02215148ff3a-1
the Arduino IDE and install it from there. 0.4.0 (latest) 0.3.0 0.2.0 0.1.0
https://www.arduino.cc/reference/en/libraries/sensor-communication-library/index.html
6fefa88fd2d2-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 > Nimble arduino NimBLE-Arduino Communication Bluetooth low energy (BLE) library for arduino-esp32 based on NimBLE. This is a more updated and lower resource alternative to the original bluedroid BLE library for esp32. Uses 50% less flash space and approximately 100KB less ram with the same functionality. Nearly 100% compatible with existing application code, migration guide included. Author: h2zero Maintainer: h2zero Read the documentation Compatibility
https://www.arduino.cc/reference/en/libraries/nimble-arduino/index.html
6fefa88fd2d2-1
Maintainer: h2zero Read the documentation Compatibility This library is compatible with the esp32, arm-ble architectures. Releases To use this library, open the Library Manager in the Arduino IDE and install it from there. 1.4.1 (latest) 1.4.0 1.3.8 1.3.7 1.3.6 1.3.5 1.3.4 1.3.3 1.3.1 1.3.0 1.2.0 1.1.0 1.0.2 1.0.1 1.0.0
https://www.arduino.cc/reference/en/libraries/nimble-arduino/index.html
ded1f82da677-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 > Tamc gt911 TAMC_GT911 Display Arduino library for GT911 Arduino library for GT911 Touch Panel Author: TAMC Maintainer: TAMC Read the documentation Compatibility This library is compatible with the esp32 architecture. Releases To use this library, open the Library Manager in the Arduino IDE and install it from there. 1.0.2 (latest) 1.0.1 1.0.0
https://www.arduino.cc/reference/en/libraries/tamc_gt911/index.html
b3df500633e5-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 > Andee Andee Device Control Annikken Andee Library for Annikken Andee U, Android and iOS boards. Only supports Arduino Uno, Leonardo and Mega Author: Annikken Pte Ltd Maintainer: Annikken Pte Ltd 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.
https://www.arduino.cc/reference/en/libraries/andee/index.html
b3df500633e5-1
the Arduino IDE and install it from there. 3.3.2 (latest) 3.3.1 3.3.0 3.2.8 3.2.7 3.2.6 3.2.5 3.2.4 3.2.2 3.2.1 3.2.0 3.1.3 3.1.1
https://www.arduino.cc/reference/en/libraries/andee/index.html
9b7389197b87-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 > Rakwireless storage RAKwireless Storage Data Storage Driver for WisBlock Storage modules Driver for WisBlock Storage RAK15000 Author: RAKwireless Maintainer: RAKwireless 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. 1.0.2
https://www.arduino.cc/reference/en/libraries/rakwireless-storage/index.html
9b7389197b87-1
the Arduino IDE and install it from there. 1.0.2 (latest) 1.0.1 1.0.0
https://www.arduino.cc/reference/en/libraries/rakwireless-storage/index.html
2f84f065d6c5-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 > Ovs OVS Data Processing Simple Arduino library for oversampling ADC and other data Author: AlexGyver Maintainer: AlexGyver 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.1.0 (latest) 1.0.0
https://www.arduino.cc/reference/en/libraries/ovs/index.html
f3bfc823fd16-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 > Tcone TCone Timing MicroBeaut-TCone Library with Timer and Counter One. MicroBeaut-TCone Library provided Timer and Counter One interoperation with a subroutine for Arduino. Author: Montree Hamarn, Natvalun Tavepontakul Maintainer: Montree Hamarn Read the documentation 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
https://www.arduino.cc/reference/en/libraries/tcone/index.html
f3bfc823fd16-1
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.0.1 (latest) 1.0.0
https://www.arduino.cc/reference/en/libraries/tcone/index.html
f0c4788da535-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 > Rtc rv 3028 c7 arduino library RTC RV-3028-C7 Arduino Library Timing A library to drive the RV-3028-C7 extremely precise, extremely low power, real-time clock
https://www.arduino.cc/reference/en/libraries/rtc-rv-3028-c7-arduino-library/index.html
f0c4788da535-1
The RV-3028-C7 is an extremely precise, extremely low power, highly configurable RTC. Under ideal conditions it runs at approximately 40nA with +/-5ppm per year of deviation (+/- 160 seconds worst case per year). This library was originally forked from the Sparkfun RV-1805 library, and costumized and enhanced to the RV-3028-C7. Author: Constantin Koch Maintainer: Constantin Koch - [email protected] 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. 2.1.0 (latest) 2.0.1 2.0.0
https://www.arduino.cc/reference/en/libraries/rtc-rv-3028-c7-arduino-library/index.html
3319cfb6aa5d-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 > 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.
https://www.arduino.cc/reference/en/libraries/tetrisanimation/index.html
3319cfb6aa5d-1
the Arduino IDE and install it from there. 1.1.0 (latest)
https://www.arduino.cc/reference/en/libraries/tetrisanimation/index.html
cebb67b094ac-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 > 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
https://www.arduino.cc/reference/en/libraries/espectro32/index.html
cebb67b094ac-1
Compatibility This library is compatible with the esp32 architecture. Releases To use this library, open the Library Manager in the Arduino IDE and install it from there. 0.2.0 (latest)
https://www.arduino.cc/reference/en/libraries/espectro32/index.html
a6525afdf5ac-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 > 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
https://www.arduino.cc/reference/en/libraries/hactimers/index.html
a6525afdf5ac-1
Releases To use this library, open the Library Manager in the Arduino IDE and install it from there. 0.1.4 (latest) 0.1.2 0.1.1 0.1.0
https://www.arduino.cc/reference/en/libraries/hactimers/index.html
2efbeee27cbe-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 > 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
https://www.arduino.cc/reference/en/libraries/gst/index.html
012a5bbcbd56-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.
https://www.arduino.cc/reference/en/libraries/lsm6/index.html
012a5bbcbd56-1
the Arduino IDE and install it from there. 2.0.1 (latest) 2.0.0 1.0.0
https://www.arduino.cc/reference/en/libraries/lsm6/index.html
6934890182cc-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 > 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 [email protected] 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.
https://www.arduino.cc/reference/en/libraries/afarray/index.html
6934890182cc-1
the Arduino IDE and install it from there. 0.4.0 (latest) 0.3.1 0.2.2 0.2.0 0.1.1 0.1.0
https://www.arduino.cc/reference/en/libraries/afarray/index.html
d8f4e7bcaef9-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 > 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
https://www.arduino.cc/reference/en/libraries/tuyav/index.html
d8f4e7bcaef9-1
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
https://www.arduino.cc/reference/en/libraries/tuyav/index.html
18ff9a4cbe59-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 ([email protected]) 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.
https://www.arduino.cc/reference/en/libraries/ustepper-s-lite/index.html
18ff9a4cbe59-1
the Arduino IDE and install it from there. 1.2.0 (latest) 1.1.0 1.0.0 0.1.1 0.1.0
https://www.arduino.cc/reference/en/libraries/ustepper-s-lite/index.html
7c8491cf88cd-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 > 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
https://www.arduino.cc/reference/en/libraries/usbmidi/index.html
7c8491cf88cd-1
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
https://www.arduino.cc/reference/en/libraries/usbmidi/index.html
b58420aee008-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
https://www.arduino.cc/reference/en/libraries/multi_oled/index.html
b58420aee008-1
the Arduino IDE and install it from there. 1.0.0 (latest)
https://www.arduino.cc/reference/en/libraries/multi_oled/index.html
083262538e5e-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([email protected]),tangjie([email protected]) Read the documentation Compatibility
https://www.arduino.cc/reference/en/libraries/dfrobot_mcp4725/index.html
083262538e5e-1
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.1 (latest)
https://www.arduino.cc/reference/en/libraries/dfrobot_mcp4725/index.html
28a164363b05-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 > 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
https://www.arduino.cc/reference/en/libraries/esp-dash/index.html
28a164363b05-1
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
https://www.arduino.cc/reference/en/libraries/esp-dash/index.html
7414f0ad6617-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)
https://www.arduino.cc/reference/en/libraries/sodaq_bmp085/index.html
7414f0ad6617-1
1.4.0 (latest) 1.3.0 1.2.1 1.2.0
https://www.arduino.cc/reference/en/libraries/sodaq_bmp085/index.html
db645eecd3da-0
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.
https://www.arduino.cc/reference/en/language/structure/further-syntax/include/index.html
db645eecd3da-1
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>
https://www.arduino.cc/reference/en/language/structure/further-syntax/include/index.html
db645eecd3da-2
#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'
https://www.arduino.cc/reference/en/language/structure/further-syntax/include/index.html
db645eecd3da-3
myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } } See also
https://www.arduino.cc/reference/en/language/structure/further-syntax/include/index.html
6e7a5e3a7353-0
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
https://www.arduino.cc/reference/en/language/structure/further-syntax/define/index.html
6e7a5e3a7353-1
> 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
https://www.arduino.cc/reference/en/language/structure/further-syntax/define/index.html
6e7a5e3a7353-2
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
https://www.arduino.cc/reference/en/language/structure/further-syntax/define/index.html
2cbf970e758c-0
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
https://www.arduino.cc/reference/en/language/structure/further-syntax/blockcomment/index.html
2cbf970e758c-1
> 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.
https://www.arduino.cc/reference/en/language/structure/further-syntax/blockcomment/index.html
2cbf970e758c-2
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
https://www.arduino.cc/reference/en/language/structure/further-syntax/blockcomment/index.html
c897e60647cf-0
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.
https://www.arduino.cc/reference/en/language/structure/further-syntax/curlybraces/index.html
c897e60647cf-1
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
https://www.arduino.cc/reference/en/language/structure/further-syntax/curlybraces/index.html
c897e60647cf-2
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
https://www.arduino.cc/reference/en/language/structure/further-syntax/curlybraces/index.html
6e753702101a-0
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
https://www.arduino.cc/reference/en/language/structure/further-syntax/semicolon/index.html
6e753702101a-1
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
https://www.arduino.cc/reference/en/language/structure/further-syntax/semicolon/index.html
645a9cf56655-0
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
https://www.arduino.cc/reference/en/language/structure/further-syntax/singlelinecomment/index.html
645a9cf56655-1
> 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;
https://www.arduino.cc/reference/en/language/structure/further-syntax/singlelinecomment/index.html
645a9cf56655-2
// 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
https://www.arduino.cc/reference/en/language/structure/further-syntax/singlelinecomment/index.html
e591699eadd1-0
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
https://www.arduino.cc/reference/en/language/structure/comparison-operators/lessthanorequalto/index.html
e591699eadd1-1
<= [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
https://www.arduino.cc/reference/en/language/structure/comparison-operators/lessthanorequalto/index.html
e591699eadd1-2
// do something only if the comparison result is true } Notes and Warnings Negative numbers are smaller than positive numbers. See also
https://www.arduino.cc/reference/en/language/structure/comparison-operators/lessthanorequalto/index.html
b40a82c34300-0
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
https://www.arduino.cc/reference/en/language/structure/comparison-operators/lessthan/index.html
b40a82c34300-1
> 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
https://www.arduino.cc/reference/en/language/structure/comparison-operators/lessthan/index.html
b40a82c34300-2
// do something only if the comparison result is true } Notes and Warnings Negative numbers are less than positive numbers. See also
https://www.arduino.cc/reference/en/language/structure/comparison-operators/lessthan/index.html
5092aca4a3ee-0
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
https://www.arduino.cc/reference/en/language/structure/comparison-operators/equalto/index.html
5092aca4a3ee-1
> 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
https://www.arduino.cc/reference/en/language/structure/comparison-operators/equalto/index.html
8e372358b643-0
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
https://www.arduino.cc/reference/en/language/structure/comparison-operators/greaterthan/index.html
8e372358b643-1
> 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
https://www.arduino.cc/reference/en/language/structure/comparison-operators/greaterthan/index.html
8e372358b643-2
// do something only if the comparison result is true } Notes and Warnings Positive numbers are greater than negative numbers. See also
https://www.arduino.cc/reference/en/language/structure/comparison-operators/greaterthan/index.html
0b86dda1f704-0
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
https://www.arduino.cc/reference/en/language/structure/comparison-operators/greaterthanorequalto/index.html
0b86dda1f704-1
>= [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
https://www.arduino.cc/reference/en/language/structure/comparison-operators/greaterthanorequalto/index.html
0b86dda1f704-2
// do something only if the comparison result is true } Notes and Warnings Positive numbers are greater than negative numbers. See also
https://www.arduino.cc/reference/en/language/structure/comparison-operators/greaterthanorequalto/index.html
3cbfa518bf21-0
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
https://www.arduino.cc/reference/en/language/structure/comparison-operators/notequalto/index.html
3cbfa518bf21-1
> 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
https://www.arduino.cc/reference/en/language/structure/comparison-operators/notequalto/index.html
67219333c397-0
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
https://www.arduino.cc/reference/en/language/structure/pointer-access-operators/dereference/index.html
67219333c397-1
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
https://www.arduino.cc/reference/en/language/structure/pointer-access-operators/dereference/index.html
58ed86f100b7-0
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
https://www.arduino.cc/reference/en/language/structure/pointer-access-operators/reference/index.html
58ed86f100b7-1
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
https://www.arduino.cc/reference/en/language/structure/pointer-access-operators/reference/index.html
6a01272accec-0
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
https://www.arduino.cc/reference/en/language/structure/compound-operators/compounddivision/index.html
6a01272accec-1
Syntax x /= y; // equivalent to the expression x = x / y; Parameters x: variable. Allowed data types: int, float, double, byte, short, long. y: non zero variable or constant. Allowed data types: int, float, double, byte, short, long. Example Code x = 2; x /= 2; // x now contains 1 See also LANGUAGE Normal Division
https://www.arduino.cc/reference/en/language/structure/compound-operators/compounddivision/index.html
263d75fe18c3-0
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
https://www.arduino.cc/reference/en/language/structure/compound-operators/compoundmultiplication/index.html
263d75fe18c3-1
Syntax x *= y; // equivalent to the expression x = x * 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 x = 2; x *= 3; // x now contains 6 See also LANGUAGE Normal Multiplication
https://www.arduino.cc/reference/en/language/structure/compound-operators/compoundmultiplication/index.html
6dcf2a4d028c-0
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
https://www.arduino.cc/reference/en/language/structure/compound-operators/compoundremainder/index.html
6dcf2a4d028c-1
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
https://www.arduino.cc/reference/en/language/structure/compound-operators/compoundremainder/index.html
fbcc01df1fa4-0
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:
https://www.arduino.cc/reference/en/language/structure/compound-operators/compoundbitwiseor/index.html
fbcc01df1fa4-1
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
https://www.arduino.cc/reference/en/language/structure/compound-operators/compoundbitwiseor/index.html
fbcc01df1fa4-2
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
https://www.arduino.cc/reference/en/language/structure/compound-operators/compoundbitwiseor/index.html
fbcc01df1fa4-3
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
https://www.arduino.cc/reference/en/language/structure/compound-operators/compoundbitwiseor/index.html
ca67c76ca89b-0
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.
https://www.arduino.cc/reference/en/language/structure/compound-operators/compoundbitwiseand/index.html
ca67c76ca89b-1
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
https://www.arduino.cc/reference/en/language/structure/compound-operators/compoundbitwiseand/index.html
ca67c76ca89b-2
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 ----------------------
https://www.arduino.cc/reference/en/language/structure/compound-operators/compoundbitwiseand/index.html
ca67c76ca89b-3
---------------------- 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
https://www.arduino.cc/reference/en/language/structure/compound-operators/compoundbitwiseand/index.html
fde48b3f5d86-0
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
https://www.arduino.cc/reference/en/language/structure/compound-operators/increment/index.html
fde48b3f5d86-1
++x; // increment x by one and returns the new value of x Parameters x: variable. Allowed data types: int, long (possibly unsigned). Returns The original or newly incremented value of the variable. Example Code x = 2; y = ++x; // x now contains 3, y contains 3 y = x++; // x contains 4, but y still contains 3 See also
https://www.arduino.cc/reference/en/language/structure/compound-operators/increment/index.html
0bf8af1d8645-0
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
https://www.arduino.cc/reference/en/language/structure/compound-operators/compoundsubtraction/index.html
0bf8af1d8645-1
Syntax x -= y; // equivalent to the expression x = x - 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 x = 20; x -= 2; // x now contains 18 See also LANGUAGE Normal Subtraction
https://www.arduino.cc/reference/en/language/structure/compound-operators/compoundsubtraction/index.html
a4c1897dfa8e-0
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
https://www.arduino.cc/reference/en/language/structure/compound-operators/compoundbitwisexor/index.html
a4c1897dfa8e-1
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
https://www.arduino.cc/reference/en/language/structure/compound-operators/compoundbitwisexor/index.html