File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
examples/streams-memory_wav-pwm Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ MemoryStream -> AudioOutputStream -> WAVDecoder -> AudioPWM
8
8
9
9
The pins depend on the Processor:
10
10
11
- | PIEZO | ESP32 | RPI Pico |
12
- | --------| --------------- | -----------------|
13
- | + | GPIO4 | GPIO2 |
14
- | - | GND | |
11
+ | PIEZO | ESP32 | RPI Pico | MBED |
12
+ | --------| -------------| -- ------------- | --------------|
13
+ | + | GPIO4 | GPIO2 | GPIO2 |
14
+ | - | GND | | |
15
15
Original file line number Diff line number Diff line change @@ -37,10 +37,12 @@ struct PWMConfig {
37
37
uint8_t buffers = PWM_BUFFERS;
38
38
39
39
// additinal info
40
- uint16_t start_pin = PWM_START_PIN;
41
40
uint32_t pwm_frequency = PWM_FREQUENCY; // audable range is from 20 to 20,000Hz (not used by ESP32)
42
41
uint8_t resolution = 8 ; // Only used by ESP32: must be between 8 and 11 -> drives pwm frequency
43
42
uint8_t timer_id = 0 ; // Only used by ESP32 must be between 0 and 3
43
+
44
+ #ifndef __AVR__
45
+ uint16_t start_pin = PWM_START_PIN;
44
46
45
47
// define all pins by passing an array and updates the channels by the number of pins
46
48
template <size_t N>
@@ -55,12 +57,13 @@ struct PWMConfig {
55
57
start_pin = -1 ; // mark start pin as invalid
56
58
}
57
59
60
+ #endif
61
+
58
62
void logConfig (){
59
63
LOGI (" sample_rate: %d" , sample_rate);
60
64
LOGI (" channels: %d" , channels);
61
65
LOGI (" bits_per_sample: %d" , bits_per_sample);
62
66
LOGI (" buffer_size: %d" , buffer_size);
63
- LOGI (" start_pin: %d" , start_pin);
64
67
LOGI (" pwm_frequency: %d" , pwm_frequency);
65
68
// LOGI("resolution: %d", resolution);
66
69
// LOGI("timer_id: %d", timer_id);
You can’t perform that action at this time.
0 commit comments