Buenas, estoy desarrollando un proyecto en el cual necesito transmitir voz inalambricamente. Estoy usando dos nRF24L01 para transmitir de un arduino a otro. Me guie de un proyecto que encontré en internet sobre un walkie talkie con arduino pero hasta ahora he probado y no funciona. No se si lo que este mal sean los circuitos o el código.
#include <RF24.h>
#include <SPI.h>
#include <RF24Audio.h>
#include "printf.h" // General includes for radio and audio lib
RF24 radio(7,8); // Set radio up using pins 7 (CE) 8 (CS)
RF24Audio rfAudio(radio,0); // Set up the audio using the radio, and set to radio number 0
void setup() {
Serial.begin(115200);
printf_begin();
radio.begin();
radio.printDetails();
rfAudio.begin();
rfAudio.receive(); // cambiar por rfAudio.transmit() para el emisor
}
void loop()
{
}
En el codigo del proyecto walkie talkie original habia un void talk el cual cambiaba el estado de receptor a transmisor al apretar un boton. (Link de codigo original: Aqui)
Fichero printf.h
/*
Copyright (C) 2011 J. Coliz <maniacbug@ymail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
*/
/**
* @file printf.h
*
* Setup necessary to direct stdout to the Arduino Serial library, which
* enables 'printf'
*/
#ifndef __PRINTF_H__
#define __PRINTF_H__
#ifdef ARDUINO
int serial_putc( char c, FILE * )
{
Serial.write( c );
return c;
}
void printf_begin(void)
{
fdevopen( &serial_putc, 0 );
}
#else
#error This example is only for use on Arduino.
#endif // ARDUINO
#endif // __PRINTF_H__
El circuito de microfono:
Link del proyecto de walkie talkie original: Aqui
Agradeceria que alguien que tenga conocimientos sobre el tema me dijera que estoy haciendo mal. Muchas gracias de antemano.