RF24Audio  v1.0
Arduino Audio Streaming Realtime with NRF24L01 radios
 All Classes Files Functions Pages
userConfig.h
1 
2 
3 
4 /***********************************************
5 //******* MANDATORY User Variables **************/
6 
7  // Maximum Range: Sample rate 16000, RF_SPEED RF24_250KBPS
8  // Maximum Quality: Sample rate 44000, RF_SPEED RF24_2MBPS
9 
10 #define SAMPLE_RATE 24000 // The sample rate to use for transferring audio samples Note: 44khz+ sample rate requires 8-bits per sample
11 #define RF_SPEED RF24_1MBPS // RF24_250KBPS will do 13-20khz+ sample rate, RF24_1MBPS up to 24-44khz+, RF24_2MBPS for higher. These are not limits, just a guide.
12 #define ANALOG_PIN A0 // The pin that analog readings will be taken from (microphone pin)
13 
14 /************ OverRides *************************/
15 
16 //10-bit audio requires more bandwidth. A 20khz sample rate will need 25KB/S transfer rate, which is about max for 250kbps data rate.
17 //With a 32khz sample rate, the volume can be set to -1 to shift the sample down to 9-bit, which is the highest the timers can handle at 32khz
18 //#define tenBit // Enable 10-bit samples Note: 44khz+ sample rate requires 8-bits per sample
19 
20 //#define speakerPin 9 // If using a non-standard board, override the timer1 pins
21 //#define speakerPin 10
22 #define ENABLE_LED // Indicator pin. Using pin 6 on Uno enables audio visualization. Pin 13 on Mega 2560 (TIMER0 COMPA) The pin# cannot be changed.
23 
24 /***************** Optional/Advanced User Variables ******/
25 
26 //#define MANUAL_BUTTON_HANDLING // Disables button handling via timer0. Allow users to customize button handling
27 #define TX_PIN A1 // Button pin to trigger recording & transmission
28 #define VOL_UP_PIN A2 // Pin for external volume control
29 #define VOL_DN_PIN A3 // Pin for external volume control
30 #define REMOTE_TX_PIN A4 // Pin for externally triggering remote recording
31 #define REMOTE_RX_PIN 4 // Pin for externally stopping remote recording (needs timeout enabled)
32 #define buffSize 32 // The size of the memory buffer to use. Not really configurable.
33 
34 //#define speakerTX // Whether to output to speaker while transmitting
35 //#define oversampling // Oversampling is recommended for low sample rates only. This only affects playback.
36 //#define RX_ONLY
37 //#define TX_ONLY // Not functional yet
38 
39 
40 /********* Automated pin selections, override by defining above ************/
41 
42 
43 #if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || (__AVR_ATmega32U4__) || (__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__) || (__AVR_ATmega128__) ||defined(__AVR_ATmega1281__)||defined(__AVR_ATmega2561__)
44  #define rampMega
45 
46  #if !defined (speakerPin) //Speaker pin selection for mega etc
47  #define speakerPin 11 //The pins to output audio on. (11,12 on Mega 2560)
48  #endif
49  #if !defined (speakerPin2)
50  #define speakerPin2 12
51  #endif
52  #if defined (ENABLE_LED)
53  #define ledPin 13
54  #endif
55 
56 #else //Speaker selection for Uno,Nano, etc
57 
58  #if !defined (speakerPin)
59  #define speakerPin 9 //The pins to output audio on. (9,10 on UNO,Nano)
60  #endif
61  #if !defined (speakerPin2)
62  #define speakerPin2 10
63  #endif
64 
65  #if defined (ENABLE_LED)
66  #define ledPin 6
67  #endif
68 #endif
69 
70 
71 //********Radio Defines ****************************
72 // Radio pipe addresses for the 2 nodes to communicate.
73 const uint64_t pipes[14] = { 0xABCDABCD71LL, 0x544d52687CLL, 0x544d526832LL, 0x544d52683CLL,0x544d526846LL, 0x544d526850LL,0x544d52685ALL, 0x544d526820LL, 0x544d52686ELL, 0x544d52684BLL, 0x544d526841LL, 0x544d526855LL,0x544d52685FLL,0x544d526869LL};
74 
75 
76 
77 
78 
79 
80 
81 
82 
83 
84 
85 
86 
87