Skip to content
Shop

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.

Open Gemini

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.

  • Basic Kit
  • Data-capable USB cable
  • PC (Windows, macOS or Linux)

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.

  1. From the Arduino website, go to SOFTWARE and then DOWNLOADS to get to the Arduino IDE download page.
  2. Download the installer for your OS at the place where it says Download the Arduino IDE.
  3. Run the downloaded installer and follow the on-screen instructions to install the Arduino IDE.

Older Arduino IDE installers are available from Previous IDE Releases.

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.

  1. Arduino AVR Boards is installed with the IDE. Open Tools → Board → Boards Manager to check its version. Use the version selector to install an earlier version.

  1. Go to Tools → Board and select Arduino Pro or Pro Mini and ATmega328P (3.3V, 8MHz) for Processor.



  1. Go to Tools → Serial Port and 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”
  1. In the Arduino IDE, click on File → Sketch Examples → 01.Basics → Blink to open the sample app.
  2. The program is written to Leafony by pressing the write to microcontroller button.
  3. If you can confirm that the LED on the AVR MCU leaf is blinking, you are done.

The pin should be specified by its name.

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.

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:

  1. Open the GitHub repository above and select Code → Download ZIP.
  2. In Arduino IDE, choose Sketch → Include Library → Add .ZIP Library and select the downloaded ZIP file.
  3. 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.

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.

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.

Launch the Arduino and choose Sketch → Include Library → Install ZIP Library to load the zip file you just downloaded.



If it doesn’t work, go to “If it doesn’t work…” to find a solution.