Help with additional inputs (when ADC is busy) (rotary encoder?)

Status
Not open for further replies.

Davidelvig

Well-known member
I'm using an Audio library AudioInputAnalog object - connected by default to pin A2, and presumably ADC0
Code:
/*relevant snip 
...
AudioInputAnalog         adc1; 
...
*/

//full audio declaration:

#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

// GUItool: begin automatically generated code
AudioInputAnalog         adc1;           //xy=96.88888549804688,95.66666412353516
AudioSynthWaveformSine   sineH3;         //xy=148.88888549804688,428.6666660308838
AudioSynthWaveformSine   sineH2;         //xy=150.88888549804688,383.6666660308838
AudioSynthWaveformSine   sineH4;         //xy=150.88888549804688,471.6666660308838
AudioSynthWaveformSine   sineFundamental; //xy=180.88888549804688,335.6666660308838
AudioMixer4              micMixer;         //xy=269,75
AudioAnalyzeFFT1024      FFT;            //xy=414.8888854980469,163.6666717529297
#ifdef USE_YIN
AudioAnalyzeNoteFrequency YIN;            //xy=415.8888854980469,204.6666717529297
#endif // USE_YIN
AudioAnalyzePeak         peak1;          //xy=417,249
AudioAnalyzeRMS          rms1;           //xy=417,286
AudioMixer4              rightMixer;     //xy=569.8888854980469,394.6666660308838
AudioMixer4              leftMixer;      //xy=572.888916015625,94.66666412353516
AudioEffectEnvelope      noteEnvelope;   //xy=648.8888854980469,280.6666660308838
AudioOutputUSB           usbOutput;      //xy=761.8888854980469,197.6666660308838
AudioInputI2S            i2s1;           //xy=799,622
AudioConnection          patchCord1(adc1, 0, micMixer, 0);
AudioConnection          patchCord2(sineH3, 0, rightMixer, 2);
AudioConnection          patchCord3(sineH2, 0, rightMixer, 1);
AudioConnection          patchCord4(sineH4, 0, rightMixer, 3);
AudioConnection          patchCord5(sineFundamental, 0, rightMixer, 0);
AudioConnection          patchCord6(micMixer, 0, leftMixer, 0);
AudioConnection          patchCord7(micMixer, FFT);
#ifdef USE_YIN
AudioConnection          patchCord8(micMixer, YIN);
#endif // USE_YIN
AudioConnection          patchCord9(micMixer, peak1);
AudioConnection          patchCord10(micMixer, rms1);
AudioConnection          patchCord11(rightMixer, noteEnvelope);
AudioConnection          patchCord12(leftMixer, 0, usbOutput, 0);
AudioConnection          patchCord13(noteEnvelope, 0, usbOutput, 1);
// GUItool: end automatically generated code
I've tried to use a potentiometer on ADC1 at the same time with little luck.

I think a rotary encoder might be what I need, or some other method to get scrolling values from a twist control. (a pot could have worked).

What technologies should I try?
e.g.
- brands of rotary encoders and a good Teensy library to use?
- other similar technologies
- an example of the AudioInputAnalog object working with an analog pot on the other ADC

Thanks!
 
I've tried to use a potentiometer on ADC1 at the same time with little luck.

Only certain analog pins actually use ADC1. Almost all of them use ADC0.

I think a rotary encoder might be what I need, or some other method to get scrolling values from a twist control. (a pot could have worked).

The Encoder lib should work fine together with the audio lib, as long as your encoders aren't really fast (eg, connected to motors).

https://www.pjrc.com/teensy/td_libs_Encoder.html
 
Thanks, Paul,

I've spent a fair amount of time with the ADC0 & ADC1 choice over the last year.

Can you point me to link for an encoder compatible with the encoder library?
 
Any users of Rotary Encoders with the Teensy out there?
I could use a link to a product that works with the library Paul mentions above.
 
Status
Not open for further replies.
Back
Top