User Manual

Code analysis
#include <>
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.
Note that
#include , similar to #define , has no semicolon terminator, and the compiler will
yield cryptic error messages if you add one.
#include is an instruction that introduces a header file. Here we use the DHT.h, <Arduino.h>,
<U8g2lib.h>, <SPI.h>, <Wire.h> library, these library are included in Arduino IDE.
#define
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.
Force a variable to be the value you want.
U8X8_SSD1306_128X64_ALT0_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE);
Once the object is declared, you can use functions from the library.
u8x8.begin();
Description:
Simplified setup procedure of the display for the Arduino environment. See the setup guide for
the selection of a suitable U8g2 constructor.
Syntax:
u8x8.begin()
Initialize the u8g2 library
u8x8.setFlipMode(1);
44
Grove Beginner Kit For Arduino®