mirror of
https://github.com/MOSH-Insa-Toulouse/5ISS-2024-2025-MARIN--MULLER-BOUJON.git
synced 2025-06-08 14:00:49 +02:00
Test RN2483A LoRa module
This commit is contained in:
parent
3801a23589
commit
31059a780b
3 changed files with 27 additions and 28 deletions
4
README.md
Normal file
4
README.md
Normal file
|
@ -0,0 +1,4 @@
|
|||
|
||||
Response from "sys get ver" command :
|
||||
RN2483 1.0.5 Oct 31 2018 15:06:52
|
||||
|
|
@ -11,8 +11,5 @@
|
|||
[env:esp32dev]
|
||||
platform = espressif32
|
||||
board = esp32dev
|
||||
framework = arduino
|
||||
lib_deps =
|
||||
olikraus/U8g2@^2.36.2
|
||||
adafruit/Adafruit SSD1306@^2.5.13
|
||||
adafruit/Adafruit GFX Library@^1.11.11
|
||||
monitor_speed = 115200
|
||||
framework = arduino
|
44
src/main.cpp
44
src/main.cpp
|
@ -1,32 +1,30 @@
|
|||
#include <Arduino.h>
|
||||
#include <Wire.h>
|
||||
#include <Adafruit_GFX.h>
|
||||
#include <Adafruit_SSD1306.h>
|
||||
#include <HardwareSerial.h>
|
||||
|
||||
#define SCREEN_WIDTH 128
|
||||
#define SCREEN_HEIGHT 64
|
||||
#define SSD1306_ADDR 0x3C
|
||||
|
||||
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
|
||||
HardwareSerial mySerial(0); // Use UART0 (RX0, TX0)
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
Serial.begin(115200); // Initialize Serial Monitor
|
||||
mySerial.begin(57600); // Initialize RN2483A Serial communication
|
||||
|
||||
if(!display.begin(SSD1306_SWITCHCAPVCC, SSD1306_ADDR)) {
|
||||
Serial.println(F("SSD1306 allocation failed"));
|
||||
for(;;);
|
||||
Serial.println("Testing RN2483A module...");
|
||||
|
||||
// Send a command to the RN2483A module
|
||||
mySerial.println("sys get ver");
|
||||
|
||||
// Wait for a response
|
||||
delay(1000);
|
||||
|
||||
// Read the response from the RN2483A module
|
||||
while (mySerial.available()) {
|
||||
String response = mySerial.readString();
|
||||
Serial.println("RN2483A Response: " + response);
|
||||
}
|
||||
delay(2000);
|
||||
display.clearDisplay();
|
||||
|
||||
display.setTextSize(1);
|
||||
display.setTextColor(WHITE);
|
||||
display.setCursor(0, 10);
|
||||
// Display static text
|
||||
display.println("Hello, world!");
|
||||
display.display();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
}
|
||||
// Idle loop
|
||||
mySerial.begin(115200);
|
||||
Serial.println("Idle...");
|
||||
delay(1000);
|
||||
}
|
Loading…
Add table
Reference in a new issue