|
@ -59,6 +59,7 @@ void Sound::init() { |
|
|
i2s_driver_install(i2s_num, &i2s_config, 0, NULL); |
|
|
i2s_driver_install(i2s_num, &i2s_config, 0, NULL); |
|
|
i2s_set_pin(i2s_num, &pin_config); |
|
|
i2s_set_pin(i2s_num, &pin_config); |
|
|
|
|
|
|
|
|
|
|
|
/* play a sine wave (example code) */ |
|
|
triangle_float = -32767; |
|
|
triangle_float = -32767; |
|
|
|
|
|
|
|
|
for(i = 0; i < SAMPLE_PER_CYCLE; i++) { |
|
|
for(i = 0; i < SAMPLE_PER_CYCLE; i++) { |
|
@ -76,6 +77,8 @@ void Sound::init() { |
|
|
|
|
|
|
|
|
i2s_push_sample(i2s_num, (char *)&sample_val, portMAX_DELAY); |
|
|
i2s_push_sample(i2s_num, (char *)&sample_val, portMAX_DELAY); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
stop(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void Sound::play() { |
|
|
void Sound::play() { |
|
|