Component Documentation: V3 Version 863MHz-928MHz SX1262 ESP32 WIFI Bluetooth LoRa with 0.96 OLED Display
The V3 Version 863MHz-928MHz SX1262 ESP32 WIFI Bluetooth LoRa with 0.96 OLED Display is a powerful IoT development board that integrates a range of wireless technologies, including LoRa, Wi-Fi, and Bluetooth. It is based on the ESP32 microcontroller and features a 0.96-inch OLED display for visual feedback. This document provides an overview of the component's features, specifications, and example codes to get you started with using this board in various IoT projects.
Features and Specifications
Microcontroller: ESP32
Wireless Technologies: LoRa (863MHz-928MHz), Wi-Fi, Bluetooth
Display: 0.96-inch OLED display
SX1262: LoRa transceiver module
Operating Voltage: 3.3V
Operating Temperature: -20C to 85C
Interface: USB, GPIO, SPI, I2C, UART
Example Code 1: LoRa Communication using Arduino IDE
In this example, we will demonstrate how to use the SX1262 LoRa module to send and receive data between two V3 boards.
Sender Code:
```c
#include <SPI.h>
#include <LoRa.h>
#define SCK 5
#define MISO 19
#define MOSI 27
#define SS 18
#define RST 14
LoRa lora = LoRa(SCK, MISO, MOSI, SS, RST);
void setup() {
Serial.begin(9600);
lora.begin();
lora.setFrequency(868E6);
lora.setSpreadingFactor(7);
lora.setBandwidth(250E3);
lora.setCodingRate(5);
}
void loop() {
String message = "Hello, LoRa!";
lora.beginPacket();
lora.print(message);
lora.endPacket();
delay(1000);
}
```
Receiver Code:
```c
#include <SPI.h>
#include <LoRa.h>
#define SCK 5
#define MISO 19
#define MOSI 27
#define SS 18
#define RST 14
LoRa lora = LoRa(SCK, MISO, MOSI, SS, RST);
void setup() {
Serial.begin(9600);
lora.begin();
lora.setFrequency(868E6);
lora.setSpreadingFactor(7);
lora.setBandwidth(250E3);
lora.setCodingRate(5);
}
void loop() {
int packetSize = lora.parsePacket();
if (packetSize) {
String message = "";
while (lora.available()) {
message += (char)lora.read();
}
Serial.println(message);
}
delay(1000);
}
```
Example Code 2: Wi-Fi Connectivity using MicroPython
In this example, we will demonstrate how to connect to a Wi-Fi network using MicroPython on the V3 board.
MicroPython Code:
```python
import machine
import network
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect("your_wifi_ssid", "your_wifi_password")
while not wlan.isconnected():
machine.sleep(100)
print("Connected to Wi-Fi!")
print("IP Address:", wlan.ifconfig()[0])
```
Example Code 3: OLED Display using Arduino IDE
In this example, we will demonstrate how to use the 0.96-inch OLED display to display a simple text message.
Arduino Code:
```c
#include <U8x8lib.h>
U8X8_SSD1306_096_64 u8x8(U8X8_PIN_NONE);
void setup() {
u8x8.begin();
u8x8.setFlipMode(1);
u8x8.setFont(u8x8_font_amatic_b);
}
void loop() {
u8x8.clear();
u8x8.setCursor(0, 0);
u8x8.print("Hello, OLED!");
u8x8.refresh();
delay(1000);
}
```
Note: The above code examples are for illustration purposes only and may require modifications to suit your specific project requirements.