File tree Expand file tree Collapse file tree 3 files changed +303
-260
lines changed
examples/examples-vs1053/streams-vs1053-serial Expand file tree Collapse file tree 3 files changed +303
-260
lines changed Original file line number Diff line number Diff line change
1
+ /* *
2
+ * @file streams-vs1053-serial.ino
3
+ * @author Phil Schatzmann
4
+ * @brief Reads audio data from the VS1053 microphone
5
+ *
6
+ * @author Phil Schatzmann
7
+ * @copyright GPLv3
8
+ */
9
+
10
+
11
+ #include " AudioTools.h"
12
+ #include " AudioLibs/VS1053Stream.h"
13
+
14
+ VS1053Stream in; // Access I2S as stream
15
+ CsvStream<int16_t > csvStream (Serial);
16
+ StreamCopy copier (csvStream, in); // copy in to csvStream
17
+
18
+ // Arduino Setup
19
+ void setup (void ) {
20
+ Serial.begin (115200 );
21
+ AudioLogger::instance ().begin (Serial, AudioLogger::Warning);
22
+
23
+ auto cfg = in.defaultConfig (RX_MODE);
24
+ cfg.input_device = VS1053_MIC; // or VS1053_AUX
25
+ in.begin (cfg);
26
+
27
+ // make sure that we have the correct channels set up
28
+ csvStream.begin ();
29
+
30
+ }
31
+
32
+ // Arduino loop - copy data
33
+ void loop () {
34
+ copier.copy ();
35
+ }
Original file line number Diff line number Diff line change @@ -379,7 +379,7 @@ typedef uint32_t eps32_i2s_sample_rate_type;
379
379
#endif
380
380
#define rintf (F ) static_cast<int>(F)
381
381
#define PIN_PWM_START 6
382
- #define PIN_CS CS
382
+ #define PIN_CS SS
383
383
384
384
#undef PWM_BUFFER_SIZE
385
385
#define PWM_BUFFER_SIZE 125
@@ -434,7 +434,7 @@ typedef uint32_t eps32_i2s_sample_rate_type;
434
434
#define VS1053_CS 5
435
435
#define VS1053_DCS 16
436
436
#define VS1053_DREQ 4
437
- #define VS1053_RESET -1
437
+ #define VS1053_RESET 15
438
438
#define VS1053_CS_SD -1
439
439
440
440
// use 0 for https://github.com/baldram/ESP_VS1053_Library
You can’t perform that action at this time.
0 commit comments