Arduino IDE Settings for AVR MCU
Leafony only works when you write a program.
For example, in Quick Start, a program has been written to read the four sensors and send data via Bluetooth LE.
If you are starting to use Leafony, you can make it work the way you want it to by writing a program that describes what you want it to do.
NextInstall the software needed to write a program in Leafony
What to prepare
- Basic Kit
- USB cable
- PC (Windows, Mac OS X or Linux)
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
DOWNLOADSto 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.
How to download old versions of Arduino IDE and check and change Arduino AVR Boards
Refer to Version of the Arduino IDE.
NextLet’s write a program in Leafony and make it work!
Connecting to PC
Connect to your PC with a USB cable.
Configuration of the microcontroller board
To develop Leafony in the Arduino IDE, let’s follow the steps below to configure the IDE.
- Go to
Tools → Boardand select
Arduino Pro or Pro Miniand
ATmega328P (3.3V, 8MHz)for
- Go to
Tools → Serial Portand select the serial port that Leafony is connected to
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
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 all libraries in advance.
1. Library to use
The libraries used in each Kit are as follows.
|Leaf||Required Library||Recommended version||Description|
|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||Illuminance sensor library|
|AVR MCU||MsTimer2.h||Timer interrupt library|
2. Download Library
Clicking on the links in the table above will take you to the library’s GitHub repository.
Code → Download ZIP to download the library.
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.
If it doesn’t work, go to “If it doesn’t work…” to find a solution.