Advertisement
microrobotics

DRA818V VHF Transceiver Module set Parameters

May 11th, 2023 (edited)
1,106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. The DRA818V module is a compact wireless voice transceiver module that works on the VHF band. It communicates with your microcontroller through UART (serial communication).
  3.  
  4. Assuming you are connecting DRA818V's TX to ESP32's GPIO16 (U2RXD) and DRA818V's RX to ESP32's GPIO17 (U2TXD).
  5. The commands sent to the DRA818V in this example are:
  6. */
  7.  
  8. #define DRA818V_RX 16 // Connect to TX pin of DRA818V
  9. #define DRA818V_TX 17 // Connect to RX pin of DRA818V
  10.  
  11. HardwareSerial DRA818V(2); // Using Serial2 (RX, TX)
  12.  
  13. void setup() {
  14.   // Open serial communications and wait for port to open:
  15.   Serial.begin(115200);
  16.   while (!Serial) {
  17.     ; // Wait for serial port to connect
  18.   }
  19.   Serial.println("DRA818V test!");
  20.  
  21.   // Set the data rate for the DRA818V
  22.   DRA818V.begin(9600, SERIAL_8N1, DRA818V_RX, DRA818V_TX);
  23.   delay(500);
  24.  
  25.   // Configure DRA818V
  26.   DRA818V.println("AT+DMOSETGROUP=0,144.3900,144.3900,0000,5,0001"); // Set to frequency 144.3900 MHz
  27.   delay(1000); // Wait for settings to take effect
  28.  
  29.   DRA818V.println("AT+DMOSETVOLUME=4"); // Set volume level
  30.   delay(1000); // Wait for settings to take effect
  31.  
  32.   DRA818V.println("AT+SETFILTER=1,1,1"); // Set audio filtering
  33.   delay(1000); // Wait for settings to take effect
  34.  
  35.   DRA818V.println("AT+DMOSETSQL=4"); // Set squelch level
  36.   delay(1000); // Wait for settings to take effect
  37.  
  38.   DRA818V.println("AT+SETPTTID=0000,0000"); // Set the PTT ID
  39.   delay(1000); // Wait for settings to take effect
  40. }
  41.  
  42. void loop() {
  43.   // put your main code here, to run repeatedly:
  44. }
  45.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement