Good morning, afternoon or evening, I recently acquired two E07-M1101D and two arduino nano, after trying basic examples and seeing that everything works I decided to try to transmit audio, mapping the signal from a microphone and converting it to something that can be sent, and then When receiving that, try to deconvert it to a signal that can be heard, but all this in vain, use the mobile jack to input audio and an amplifier to the output, that is not the problem, and add quite a few commands like SetTx and SetRx but all in vain, nothing seems to reproduce in the end, I send you the code the last thing I tried but there are many tests behind it, I am not an expert in code nor do I really know quite a bit, any help would be great, thanks in advance.
#include <ELECHOUSE_CC1101_SRC_DRV.h>
// Definición de pines
#define BUTTON_PIN 4
#define LED_PIN 7
#define MIC_PIN A0
#define SPEAKER_PIN 3
// Variables globales
int micValue = analogRead(MIC_PIN);
byte audioSample = map(micValue, 0, 1023, 0, 255);
bool isTransmitting = false; // Variable para controlar el modo de operación
byte buffer[61]; // Buffer para almacenar datos recibidos
byte micData = map(micValue, 0, 1023, 0, 255);
int originalData = (buffer, 0, 1023, 0, 255);
//=================================================================================================
void setup() {
Serial.begin(9600);
// Inicialización de pines
pinMode(BUTTON_PIN, INPUT);
pinMode(LED_PIN, OUTPUT);
pinMode(SPEAKER_PIN, OUTPUT);
// Inicialización del módulo CC1101
if (ELECHOUSE_cc1101.getCC1101()) {
Serial.println("Conexión OK");
} else {
Serial.println("Error de conexión");
}
ELECHOUSE_cc1101.Init();
ELECHOUSE_cc1101.setCCMode(1); // Configurar en modo recepción inicialmente
ELECHOUSE_cc1101.setModulation(0);
ELECHOUSE_cc1101.setMHZ(433.92);
ELECHOUSE_cc1101.setSyncMode(2);
ELECHOUSE_cc1101.setCrc(1);
ELECHOUSE_cc1101.setPA(10);
// Configurar interrupción por el botón
//attachInterrupt(digitalPinToInterrupt(BUTTON_PIN), buttonISR, CHANGE);
}
//============================================================================================
void loop() {
if (digitalRead(BUTTON_PIN) == HIGH) {
ELECHOUSE_cc1101.SendData(micData, 60, 10); // Enviar el dato del micrófono
digitalWrite(LED_PIN, HIGH);
}
if (digitalRead(BUTTON_PIN) == LOW){
int len = ELECHOUSE_cc1101.ReceiveData(buffer);
digitalWrite(LED_PIN, LOW);
analogWrite(SPEAKER_PIN, originalData);
}
}
//======================================================================================================================