Heltec ESP32+LoRa Series Quick Start
LoRaWAN related code has been stripped since version 3.0.0. Heltec ESP32 framework only contains the basic code now, For the special ESP32 codes please download Heltec ESP32 Series Library.
Framework v3.0.0 and Library v2.0.0 are updated together, Older frameworks and libraries are no longer applicable to the new ones.
Preparation
USB driver, you can refer to this articles establish serial connection.
Installing development framework and
There are three methods to install the development framework, choose one of they:
Via Arduino Board Manager
Open Arduino IDE, and click
File
->Peferences
.
Input the last ESP32 package URL: https://resource.heltec.cn/download/package_heltec_esp32_index.json
Click on the
Boards Manager
icon on the left side of the Arduino, and enter “heltec esp32” in the search box that pops up., then select the latest version and clickinstall
.
For special code library, search for “HELTEC ESP32” in
Library Manager
, select the latest version and install:ESP32 Series Library.
Via Git
Installing Git.
Check the following links for your operating system, the specific operation steps are detailed in the link:
For Linux
Tip
After obtaining updates through “git pull”, please execute “get. exe” under the path of “Arduino\hardware\heltec\esp32\tools” to obtain the latest compilation tool.
The above is the development environment installation. If you need to install the Heltec ESP32 extension library, you can refer to this link:Heltec ESP32 Series Library
Via Local File
Download the development environment. https://resource.heltec.cn/download/tools/esp32.zip
Open Arduino IDE, and click
File
->Peferences
.
Go to the folder in the red box.
Create a new “hardware” folder in the Arduino folder. If there is already a “hardware” folder, you don’t need to create a new one.
Creat a new “hletec” folder in “hardware” folder.
Go to the “heltec” folder and extract “esp32” into this folder.
Go to the “heltec” folder, refer to the figure below to confirm whether the path in the red box is correct.
Restart the Arduino IDE to confirm whether the development environment is installed successfully.
For the Heltec ESP32 specific code, just download the zip file and unzip it to the following path: Username/Documents/Arduino/Libraries.
Example
This section for verifying whether you can program with Arduino or not. Now, The USB cable connects to Heltec ESP32 board, then select your serial port which is connected to Heltec ESP32 board.
Select a demo example, compile and upload.
Execute an example
Correctly select a board and relevant options in the Tools
menu:
Then select an example.
Tip
To execute the code in a library, you need to mouse over, scroll down, find the library, and find the code in it.
Compile & Upload
New a Heltec ESP32 program
Open Arduino IDE, create a new .ino
file, then copy the below code.
#include <heltec.h>
// the setup routine runs once when starts up
void setup(){
// Initialize the Heltec ESP32 object
Heltec.begin(true /*DisplayEnable Enable*/, true /*LoRa Disable*/, true /*Serial Enable*/, true /*PABOOST Enable*/, 470E6 /**/);
}
// the loop routine runs over and over again forever
void loop() {
}
compile it and upload, the screen (if this board has a screen) will show and Arduino’s serial monitor will print something, it means Heltec ESP32 board is running successfully!