Using "simulated_audio_pot" with encoder #568
-
Hello everyone, I'm trying to wrap my head around using the excellent volume controls in this amazing library. I've read through the "SimulatedAudioPot Class Reference" yet I'm unsure how to implement this with a digital rotary encoder. Are there any code examples that would put me on a better track to implement a rotary encoder to control volume of the AudioKitStream output? I started with this code yet I'm sure this is not correct nor does it reference the <VolumeControl.h> library. `/** @author Phil Schatzmann #include "AudioTools.h" // Pin definitions for the rotary encoder // The rotary encoder object BluetoothA2DPSink a2dp_sink; // Write data to AudioKit in callback void setup() { // setup output // register callback void loop() { // Get the number of steps taken by the encoder // check if steps !=0 ' |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
kit.setVolume(), incrementVolume(), decrementVolume() is using the built-in volume functionality of the Audiokit. |
Beta Was this translation helpful? Give feedback.
kit.setVolume(), incrementVolume(), decrementVolume() is using the built-in volume functionality of the Audiokit.
You should not add any delay in the loop because this might disturb the audio output.
Why didn't you just use kit.incrementVolume(steps); I would expect that this should work correctly both for positive and negative values...