AVR MCU: Arduino IDE Setup
Set up with your favorite AI
Gemini & other AI
Copy the setup prompt into your AI. Work through each step together, from checking your kit to getting it running.
Copy the prompt, then paste it into Gemini’s message box.
View prompt
Use Arduino IDE to set up the development environment for the AP01 AVR MCU leaf (ATmega328P, 3.3 V, 8 MHz).
For an AP01B + AI04A + AZ01C (USB Type-C) LCD setup, see the configuration-specific quick start. Uploading through AZ01C requires a manual reset.
What to prepare
Section titled “What to prepare”- Basic Kit
- Data-capable USB cable
- PC (Windows, macOS or Linux)
Installing Arduino IDE
Section titled “Installing Arduino IDE”The Arduino IDE is a development environment for the Arduino, an open source hardware platform for electronics.
The development environment allows you to write programs, write programs to the Arduino board, and display the data coming from the board.
Leafony can be developed with the Arduino IDE.
Let’s download the Arduino IDE right away.
- From the Arduino website, go to
SOFTWAREand thenDOWNLOADSto get to the Arduino IDE download page. - Download the installer for your OS at the place where it says
Download the Arduino IDE. - Run the downloaded installer and follow the on-screen instructions to install the Arduino IDE.
Previous IDE releases
Section titled “Previous IDE releases”Older Arduino IDE installers are available from Previous IDE Releases.
Connecting to PC
Section titled “Connecting to PC”Connect to your PC with a USB cable.
Configuration of the microcontroller board
Section titled “Configuration of the microcontroller board”To develop Leafony in the Arduino IDE, let’s follow the steps below to configure the IDE.
Arduino AVR Boardsis installed with the IDE. OpenTools → Board → Boards Managerto check its version. Use the version selector to install an earlier version.

- Go to
Tools → Boardand selectArduino Pro or Pro MiniandATmega328P (3.3V, 8MHz)forProcessor.

- Go to
Tools → Serial Portand select the serial port that Leafony is connected to. If no port is available, see the FAQ.

Checking the operation of the microcontroller board
Section titled “Checking the operation of the microcontroller board”- In the Arduino IDE, click on
File → Sketch Examples → 01.Basics → Blinkto open the sample app. - The program is written to Leafony by pressing the
write to microcontrollerbutton. - If you can confirm that the LED on the AVR MCU leaf is blinking, you are done.
Specifying pins for a sketch
Section titled “Specifying pins for a sketch”The pin should be specified by its name.
Installing Libraries
Section titled “Installing Libraries”To use some of the leaves, you will need to install additional libraries.
Follow the steps below to install the libraries required by your sample.
ST7032 library for AI04 LCD
Section titled “ST7032 library for AI04 LCD”The AI04 samples use arduino_ST7032 by tomozh. Similarly named libraries such as LCD_ST7032 and ST7032_asukiaaa are different implementations. Install the specified library as follows:
- Open the GitHub repository above and select
Code → Download ZIP. - In Arduino IDE, choose
Sketch → Include Library → Add .ZIP Libraryand select the downloaded ZIP file. - Open and compile the LCD sample. If you see
ST7032.h: No such file or directory, check that the ZIP was installed. Installing the library does not enable LCD power; keep the sample’s power-control steps as well.
For assembly through your first display, see the AP01B + AI04A + AZ01C quick start.
1. Library to use
Section titled “1. Library to use”The libraries used in each Kit are as follows.
| Item | include file | Tags | Description |
|---|---|---|---|
| BLE | TBGLib.h | Bluetooth library | |
| 4-Sensors | Adafruit_Sensor.h | Unified sensor driver | |
| Adafruit_BusIO_Register.h | Bus IO library | ||
| HTS221.h | Temperature and humidity sensor library | ||
| ClosedCube_OPT3001.h [1] | 1.1.2 | Illuminance sensor library | |
| Adafruit_LIS3DH.h | 1.1.2 | Accelerometer library | |
| LCD | ST7032.h | LCD library | |
| AVR MCU | MsTimer2.h | Timer interrupt library | |
| RTC&MicroSD | RTClib.h | RTC library | |
| STM32 MCU | STM32RTC.h | 1.2.0 | STM32RTC library |
| STM32LowPower.h | 1.2.2 | STM32LowPower library | |
| LTE-M | LteLeafV4.h | LTE-M library | |
| Wi-Fi | WiFi101Leafony.h | Wi-Fi Mary library | |
| LoRa | LoRa.h | LoRa library | |
| TCA9536.h | TCA9536 library | ||
| SparkFun_ATECCX08a_Arduino_Library.h | ATECCX08a library |
[1] In Arduino IDE, open Sketch → Include Library → Manage Libraries, search for “ClosedCube OPT3001”, and install the library.
2. Download Library
Section titled “2. Download Library”Clicking on the links in the table above will take you to the library’s GitHub repository.
Click Code → Download ZIP to download the library.

3. Include Library
Section titled “3. Include Library”Launch the Arduino and choose Sketch → Include Library → Install ZIP Library to load the zip file you just downloaded.

When in doubt.
Section titled “When in doubt.”If it doesn’t work, go to “If it doesn’t work…” to find a solution.
