Teensy4.1 Encoder-Problems

Status
Not open for further replies.

Micki

Member
Hi everybody and especially Paul,

let me say first that I´m totally impressed of your work. Since Corona gives me enough time, I´m learning to work with arduinos. In my first steps I build a keyboard-controller using an arduino nano. This is my very first post in your forum and I´m looking foreward to get some help.

Now I try to build a controller with teensy4.1, 4 pots, 4 knobs, a ILI9341-Display without touch-function, USB-host and 1 encoder.
I have a problem with the encoder, so I tried to run Pauls Basic-example with my pins 31/32, later 8/9.
Code:
********************************************************
/* Encoder Library - Basic Example
 * [URL]http://www.pjrc.com/teensy/td_libs_Encoder.html[/URL]
 *
 * This example code is in the public domain.
 */

#include <Encoder.h>

// Change these two numbers to the pins connected to your encoder.
//   Best Performance: both pins have interrupt capability
//   Good Performance: only the first pin has interrupt capability
//   Low Performance:  neither pin has interrupt capability
Encoder myEnc(8, 9);                         // Edit-Box-Anpassung
//   avoid using pins with LEDs attached

void setup() {
//  pinMode(8, INPUT);           // Encoder Eingang Pin 1
//  pinMode(9, INPUT);           // Encoder Eingang Pin 2
  Serial.begin(9600);
  Serial.println("Basic Encoder Test:");
}

long oldPosition  = -999;

void loop() {
  long newPosition = myEnc.read();
  if (newPosition != oldPosition) {
    oldPosition = newPosition;
    Serial.println(newPosition);
  }
}

This is my pinout:****************************************
pinout teensy.jpg
pinout ILI9341.jpg

******************************************************

You see, I´ve tried pins 31/32 for encoder DT and CLK, later pins 8/9.
In both cases I got the following comment:


"Arduino: 1.8.13 (Windows 10), TD: 1.53, Board: "Teensy 4.1, Serial, 600 MHz, Faster, German
G:\Einplatinen Computer\Arduino IDE ZIP\arduino-1.8.13-windows\arduino-1.8.13\arduino-builder -dump-prefs -logger=machine -hardware G:\Einplatinen Computer\Arduino IDE ZIP\arduino-1.8.13-windows\arduino-1.8.13\hardware -tools G:\Einplatinen Computer\Arduino IDE ZIP\arduino-1.8.13-windows\arduino-1.8.13\tools-builder -tools G:\Einplatinen Computer\Arduino IDE ZIP\arduino-1.8.13-windows\arduino-1.8.13\hardware\tools\avr -built-in-libraries G:\Einplatinen Computer\Arduino IDE ZIP\arduino-1.8.13-windows\arduino-1.8.13\libraries -libraries G:\Einplatinen Computer\Arduino IDE ZIP\arduino-1.8.13-windows\arduino-1.8.13\portable\sketchbook\libraries -fqbn=teensy:avr:teensy41:usb=serial,speed=600,opt=o2std,keys=de-de -ide-version=10813 -build-path C:\Users\Micki\AppData\Local\Temp\arduino_build_393323 -warnings=none -build-cache C:\Users\Micki\AppData\Local\Temp\arduino_cache_575043 -verbose G:\Einplatinen Computer\Arduino IDE ZIP\arduino-1.8.13-windows\arduino-1.8.13\portable\sketchbook\Encoder_Stoffregen\Encoder_Stoffregen.ino

G:\Einplatinen Computer\Arduino IDE ZIP\arduino-1.8.13-windows\arduino-1.8.13\arduino-builder -compile -logger=machine -hardware G:\Einplatinen Computer\Arduino IDE ZIP\arduino-1.8.13-windows\arduino-1.8.13\hardware -tools G:\Einplatinen Computer\Arduino IDE ZIP\arduino-1.8.13-windows\arduino-1.8.13\tools-builder -tools G:\Einplatinen Computer\Arduino IDE ZIP\arduino-1.8.13-windows\arduino-1.8.13\hardware\tools\avr -built-in-libraries G:\Einplatinen Computer\Arduino IDE ZIP\arduino-1.8.13-windows\arduino-1.8.13\libraries -libraries G:\Einplatinen Computer\Arduino IDE ZIP\arduino-1.8.13-windows\arduino-1.8.13\portable\sketchbook\libraries -fqbn=teensy:avr:teensy41:usb=serial,speed=600,opt=o2std,keys=de-de -ide-version=10813 -build-path C:\Users\Micki\AppData\Local\Temp\arduino_build_393323 -warnings=none -build-cache C:\Users\Micki\AppData\Local\Temp\arduino_cache_575043 -verbose G:\Einplatinen Computer\Arduino IDE ZIP\arduino-1.8.13-windows\arduino-1.8.13\portable\sketchbook\Encoder_Stoffregen\Encoder_Stoffregen.ino

Using board 'teensy41' from platform in folder: G:\Einplatinen Computer\Arduino IDE ZIP\arduino-1.8.13-windows\arduino-1.8.13\hardware\teensy\avr

Using core 'teensy4' from platform in folder: G:\Einplatinen Computer\Arduino IDE ZIP\arduino-1.8.13-windows\arduino-1.8.13\hardware\teensy\avr

Detecting libraries used...

"G:\\Einplatinen Computer\\Arduino IDE ZIP\\arduino-1.8.13-windows\\arduino-1.8.13\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_GERMAN "-IG:\\Einplatinen Computer\\Arduino IDE ZIP\\arduino-1.8.13-windows\\arduino-1.8.13\\hardware\\teensy\\avr\\cores\\teensy4" "C:\\Users\\Micki\\AppData\\Local\\Temp\\arduino_build_393323\\sketch\\Encoder_Stoffregen.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE

Alternatives for Encoder.h: [Encoder@1.4.1 Encoder@1.4.1]

ResolveLibrary(Encoder.h)

-> candidates: [Encoder@1.4.1 Encoder@1.4.1]

"G:\\Einplatinen Computer\\Arduino IDE ZIP\\arduino-1.8.13-windows\\arduino-1.8.13\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_GERMAN "-IG:\\Einplatinen Computer\\Arduino IDE ZIP\\arduino-1.8.13-windows\\arduino-1.8.13\\hardware\\teensy\\avr\\cores\\teensy4" "-IG:\\Einplatinen Computer\\Arduino IDE ZIP\\arduino-1.8.13-windows\\arduino-1.8.13\\portable\\sketchbook\\libraries\\Encoder" "C:\\Users\\Micki\\AppData\\Local\\Temp\\arduino_build_393323\\sketch\\Encoder_Stoffregen.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE

"G:\\Einplatinen Computer\\Arduino IDE ZIP\\arduino-1.8.13-windows\\arduino-1.8.13\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_GERMAN "-IG:\\Einplatinen Computer\\Arduino IDE ZIP\\arduino-1.8.13-windows\\arduino-1.8.13\\hardware\\teensy\\avr\\cores\\teensy4" "-IG:\\Einplatinen Computer\\Arduino IDE ZIP\\arduino-1.8.13-windows\\arduino-1.8.13\\portable\\sketchbook\\libraries\\Encoder" "-IG:\\Einplatinen Computer\\Arduino IDE ZIP\\arduino-1.8.13-windows\\arduino-1.8.13\\portable\\sketchbook\\libraries\\Encoder\\utility" "G:\\Einplatinen Computer\\Arduino IDE ZIP\\arduino-1.8.13-windows\\arduino-1.8.13\\portable\\sketchbook\\libraries\\Encoder\\Encoder.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE

Generating function prototypes...

"G:\\Einplatinen Computer\\Arduino IDE ZIP\\arduino-1.8.13-windows\\arduino-1.8.13\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_GERMAN "-IG:\\Einplatinen Computer\\Arduino IDE ZIP\\arduino-1.8.13-windows\\arduino-1.8.13\\hardware\\teensy\\avr\\cores\\teensy4" "-IG:\\Einplatinen Computer\\Arduino IDE ZIP\\arduino-1.8.13-windows\\arduino-1.8.13\\portable\\sketchbook\\libraries\\Encoder" "C:\\Users\\Micki\\AppData\\Local\\Temp\\arduino_build_393323\\sketch\\Encoder_Stoffregen.ino.cpp" -o "C:\\Users\\Micki\\AppData\\Local\\Temp\\arduino_build_393323\\preproc\\ctags_target_for_gcc_minus_e.cpp" -DARDUINO_LIB_DISCOVERY_PHASE

"G:\\Einplatinen Computer\\Arduino IDE ZIP\\arduino-1.8.13-windows\\arduino-1.8.13\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\Micki\\AppData\\Local\\Temp\\arduino_build_393323\\preproc\\ctags_target_for_gcc_minus_e.cpp"

Sketch wird kompiliert...

"G:\\Einplatinen Computer\\Arduino IDE ZIP\\arduino-1.8.13-windows\\arduino-1.8.13\\hardware\\teensy/../tools/precompile_helper" "G:\\Einplatinen Computer\\Arduino IDE ZIP\\arduino-1.8.13-windows\\arduino-1.8.13\\hardware\\teensy\\avr/cores/teensy4" "C:\\Users\\Micki\\AppData\\Local\\Temp\\arduino_build_393323" "G:\\Einplatinen Computer\\Arduino IDE ZIP\\arduino-1.8.13-windows\\arduino-1.8.13\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -x c++-header -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_GERMAN "-IG:\\Einplatinen Computer\\Arduino IDE ZIP\\arduino-1.8.13-windows\\arduino-1.8.13\\hardware\\teensy\\avr/cores/teensy4" "C:\\Users\\Micki\\AppData\\Local\\Temp\\arduino_build_393323/pch/Arduino.h" -o "C:\\Users\\Micki\\AppData\\Local\\Temp\\arduino_build_393323/pch/Arduino.h.gch"

Using previously compiled file: C:\Users\Micki\AppData\Local\Temp\arduino_build_393323\pch\Arduino.h.gch

"G:\\Einplatinen Computer\\Arduino IDE ZIP\\arduino-1.8.13-windows\\arduino-1.8.13\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -c -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_GERMAN "-IC:\\Users\\Micki\\AppData\\Local\\Temp\\arduino_build_393323/pch" "-IG:\\Einplatinen Computer\\Arduino IDE ZIP\\arduino-1.8.13-windows\\arduino-1.8.13\\hardware\\teensy\\avr\\cores\\teensy4" "-IG:\\Einplatinen Computer\\Arduino IDE ZIP\\arduino-1.8.13-windows\\arduino-1.8.13\\portable\\sketchbook\\libraries\\Encoder" "C:\\Users\\Micki\\AppData\\Local\\Temp\\arduino_build_393323\\sketch\\Encoder_Stoffregen.ino.cpp" -o "C:\\Users\\Micki\\AppData\\Local\\Temp\\arduino_build_393323\\sketch\\Encoder_Stoffregen.ino.cpp.o"

In file included from G:\Einplatinen Computer\Arduino IDE ZIP\arduino-1.8.13-windows\arduino-1.8.13\portable\sketchbook\Encoder_Stoffregen\Encoder_Stoffregen.ino:7:0:

G:\Einplatinen Computer\Arduino IDE ZIP\arduino-1.8.13-windows\arduino-1.8.13\portable\sketchbook\libraries\Encoder/Encoder.h: In constructor 'Encoder::Encoder(uint8_t, uint8_t)':

G:\Einplatinen Computer\Arduino IDE ZIP\arduino-1.8.13-windows\arduino-1.8.13\portable\sketchbook\libraries\Encoder/Encoder.h:82:25: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment

encoder.pin1_register = PIN_TO_BASEREG(pin1);

^

G:\Einplatinen Computer\Arduino IDE ZIP\arduino-1.8.13-windows\arduino-1.8.13\portable\sketchbook\libraries\Encoder/Encoder.h:84:25: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment

encoder.pin2_register = PIN_TO_BASEREG(pin2);

^

Mehrere Bibliotheken wurden für "Encoder.h" gefunden

Benutzt: G:\Einplatinen Computer\Arduino IDE ZIP\arduino-1.8.13-windows\arduino-1.8.13\portable\sketchbook\libraries\Encoder

Nicht benutzt: G:\Einplatinen Computer\Arduino IDE ZIP\arduino-1.8.13-windows\arduino-1.8.13\hardware\teensy\avr\libraries\Encoder

Bibliothek Encoder in Version 1.4.1 im Ordner: G:\Einplatinen Computer\Arduino IDE ZIP\arduino-1.8.13-windows\arduino-1.8.13\portable\sketchbook\libraries\Encoder wird verwendet

Fehler beim Kompilieren für das Board Teensy 4.1."
*******************************************************************


I´ve read some posts about problems with arduino ide and so I buildt a new one using the portable feature. But I earned the same fault.
It would be very nice, if you can help me.
Please excuse my bad english-skills.

Keep healthy
Yours
Micki
 
Last edited by a moderator:
Which problem with the IDE?
It should work out of the box. Own builds will not work with Teensyduino - it checks the version, on install.
There are no problems.

Something is wrong with your installation.

Do it simple:
1. Forget all you read. Don't think.
2. Delete all arduino installations.
2a) Reboot.
3. Install Arduino (download the windows-zip from the official page) to c:\Arduino
4. Install Teensyduino.
Test, and see: It works :)

After that, don't forget to re-enable thinking ;)
 
@Micki What kind of encoder do you have? Is it an incremental or absolute? When you show a data and clock line, that implies an absolute position encoder. If it is a mechanical switch type, then it is likely an incremental unit and should work with Paul's Encoder.h library.

Len
 
@Micki - you don't have multiple encoder libraries installed? Like one in your libraries folder and another in the Teensyduino folder. Your sketch compiled fine for me with no issue unlike what you showed in post #1.
 
Which problem with the IDE?
It should work out of the box. Own builds will not work with Teensyduino - it checks the version, on install.
There are no problems.

Something is wrong with your installation.

Do it simple:
1. Forget all you read. Don't think.
2. Delete all arduino installations.
2a) Reboot.
3. Install Arduino (download the windows-zip from the official page) to c:\Arduino
4. Install Teensyduino.
Test, and see: It works :)

After that, don't forget to re-enable thinking ;)

Hi Frank B,
that´s exactly what I´ve done. But it doesm´t work.

With my teensy i can run other scatches (playing music etc.) Only the encoderscetch does´t work.

The error-report says:
"G:\Einplatinen Computer\Arduino IDE ZIP\arduino-1.8.13-windows\arduino-1.8.13\portable\sketchbook\libraries\Encoder/Encoder.h:82:25: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment

encoder.pin1_register = PIN_TO_BASEREG(pin1);
^
G:\Einplatinen Computer\Arduino IDE ZIP\arduino-1.8.13-windows\arduino-1.8.13\portable\sketchbook\libraries\Encoder/Encoder.h:84:25: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment
encoder.pin2_register = PIN_TO_BASEREG(pin2);
^"

I think, thats the reason why it doesn´t work. But I don´t know, what´s to do.
 
@Micki - you don't have multiple encoder libraries installed? Like one in your libraries folder and another in the Teensyduino folder. Your sketch compiled fine for me with no issue unlike what you showed in post #1.

Yes, the compiler read the one in the portable-folder an in the zip-folder.
I deleted the zip folder, but it´s the same
 
Well, your program compiles fine for other users.

Nope.

Hi Frank,
that are not so much words.

I´ve read a post from Paul Stoffregen to create a portable Arduino folder, with
- deleting the old arduino instance
- loading the arduino.zip file
- remembering, where the new arduino.ide is installed.
- careful installing the teensyduino in that folder.

So now I have a smart arduino.IDE.

I´ve deconstructed my teensy so that now it is only connected to the audio-shield.
Than i loadet the first testsketch "blink". - works
Than i tried to load Pauls encodersketch and I got the same error report.
i looked into the portable/sketchbook/libraries folder and found the Encoder entry.

I think it´s quit normal ....
 
***************************************
Update:

i´ve used another LapTop and now I can compile the scetch.
I will do a new installation asap. ;-)

But on the serial monitor I only see "0" and "1", not a counting up and down.
What can I do?

And a 2nd question:
Paul writes in the sketch, that we have the possibillity to switch the performance quality.
How can I do that?

Thanx for your tips and helping!

stay healthy
 
Think this may help you out: https://www.pjrc.com/teensy/td_libs_Encoder.html in understanding how the encoder library works.

If all you are getting in 0s and 1s it sounds like you are only registering on 1 of the encoder pins. I would check your wiring to make sure you have the ky040 hooked up correctly.

KY-040-PIC-5.png

Just make sure you use 3.3v instead of 5v!!!!!! I know those encoders work because I have tested them.
 
Think this may help you out: https://www.pjrc.com/teensy/td_libs_Encoder.html in understanding how the encoder library works.

If all you are getting in 0s and 1s it sounds like you are only registering on 1 of the encoder pins. I would check your wiring to make sure you have the ky040 hooked up correctly.

View attachment 23428

Just make sure you use 3.3v instead of 5v!!!!!! I know those encoders work because I have tested them.

Problem nearly solved !

Hi mjs513,
today I´ve tried the 2 knobs sketch with my pins 8/9 with the same results.
Than I took Pauls pins 5/6 and it works !!!!

But, what have I to do, if I want to use other pins?
I thought, that I only have to change the pinnumbers in line 13/14 ...

And playing with the sketch I saw that it jumps 2 numbers up or down in the serial monitor when i go one step with the encoder up or down.

Thanx for helping !!!
Keep healthy!
 
Last edited:
@Micki
Not sure what line 13/14 is but problem these 2 lines:
Code:
Encoder knobLeft(5, 6);
Encoder knobRight(7, 8);

If you are using a Teensy 4.x then all digital pins should be able to be used for the encoder pins. If 8,9 is not working for you maybe you should check the soldering on the t4.1 or put a multmeter to see if you have continuity between the breadboard and those pins? Possibly a cold solder joint? Not sure.
 
@Micki, you get two value increments per detent click because your encoder is a 2:1 encoder. There are also 4:1 encoders that jump 4 values per click. To solve this problem, I multiply or divide by the number of steps that the encoder uses. In my radio application, I can read any kind of incremental encoder:

VolAEncSteps is 1 for 1:1. 2 for 2:1, etc. In my application, I take this value in as a parameter in a config file on the SD card. Hopefully this example will make sense.
Code:
void ReadVolAEnc()    // called from main loop
{
  if(VolAEnc.read() % VolAEncSteps != 0)  // don't waste time if not on a detent click
  {
    return;
  }
    
  VolVal[A] = VolAEnc.read() / VolAEncSteps;    // The value kept is multiplied by VolAEncSteps, so needs to be divided out here
  
  if (VolVal[A] != VolValSave[A])    // only process if there was a change in value
  {
    if(VolVal[A] > 100)    // Max value for this encoder is 100
    {
      VolVal[A] = 100;
      VolValSave[A] = 100;
      VolAEnc.write(100 * VolAEncSteps);    // Encoder keeps VolAEncSteps * the value
    }

    if(VolVal[A] < 0)    // Min value for this encoder is 0
    {
      VolVal[A] = 0;
      VolValSave[A] = 0;
      VolAEnc.write(0);
    }
    
    fRig.setAudioGain(A,VolVal[A]);    // send new volume value to radio
    VolValSave[A] = VolVal[A];    // Save new volume value for comparison in the next pass thru loop
//    Serial.println(VolVal[A]);
  }
} // end ReadAVolEnc

Len
 
To solve this problem, I multiply or divide by the number of steps that the encoder uses.
Just a note: That works nicely if your application is not sensitive to bounces. E.g. if you use the encoder for set point applications like a volume control or similar. If you need to trigger stuff whenever the encoder value changes (e.g. for menu applications) you might run into problems with this simple approach.

The decoding algorithm of the standard Encoder library only guarantees that you end up with a correct value (modulo 2 or 4) if you rotate from one encoder detent to another. Between the detents it might (and will) generate rapid up/down counts if you use a mechanical encoder. The reason why encoders have their detents not at every encoder value is to allow for more elaborate decoding algorithms. Those algorithms can eliminate any "between detent" bouncing completely.
In case your application needs to be bounce free without rapid up/down counts between detents you can give the EncoderTool a try. In addition to the algorithm the standard encoder library provides, it uses dedicated algorithms for x2 and x4 type encoders.
 
Hi luni, Thanks for the information. On the unit that I built, I use 1:1 encoders from Leo Bodnar in England. My buddy built one with Bourns PEC-11 4:1 encoders. No problem with encoder jitter from either encoder. I am indeed using the encoders for things like volume. It is a radio controller with 9 mechanical encoders and two optical encoders, all using Encoder.h.

Does your EncoderTool allow setting the encoder to a value like Encoder does (Encoder.write(val))? This feature is important in my application because the controls on the connected radio may be changed, necessitating adjusting the encoder accordingly.

Len
 
Does your EncoderTool allow setting the encoder to a value like Encoder does (Encoder.write(val))? This feature is important in my application because the controls on the connected radio may be changed, necessitating adjusting the encoder accordingly.
Len

Sure, here the documentation: https://github.com/luni64/EncoderTool/wiki For things like volume control it also provides built in value limiting (cyclic and hard stop). Since you are using 11 encoders you might be interested in the mulitplexing capabilities as well. On the other hand never change a running system...
 
Good to know that you support multiplexed encoders. I got that question recently from a guy who is considering replicating my controller. I will pass the EncoderTool information on to him. Thanks again!

Len
 
Hallo everybody,

first let me thank you all. In the last days I made a lot of tests.
Here is my result:

1. yes, there were misconnections. I´ve used standard female patchcords to connect the t41-pins to the encoder. I will solder this in future.
2. I was not careful enough to take the right pin numbers. Pin 8 is used by the audio-shield. I did not see that. The missfunction of pins 31/32 was a mal connection.
3. I have to reinstall my arduino-IDE, because it works not save. In some cases I get the compiler-error, in other cases not. This must be fixed.
4. And thanx for the info about the 2:1-encoder. I want to use the encoder for Mode-choosing and scrolling thu a directory (later). Theres not time critical issue.

I´m looking foreward to complete my work. Thank you all !!! :D
 
Last edited:
Status
Not open for further replies.
Back
Top