Go Down

Topic: Rotary encoder midi! (Read 8653 times) previous topic - next topic

bakonyip95

I understand, but apparently everything is set correctly, no matter where they wrap only increase the value never decreases and then reaches a maximum and no more ...
Why is that?

PieterP

#16
Oct 16, 2016, 03:40 pm Last Edit: Oct 16, 2016, 03:40 pm by PieterP
My apologies for the late reply.

I installed the demo version of Traktor, and it works just fine for me with these settings:


This is the code I'm using:
Code: [Select]
#include <MIDI_controller.h>

const static byte Channel = 1;
const static byte Controller = 0x14;

RotaryEncoder enc(2, 3, Controller, 1, 1, NORMAL_ENCODER, POS1_NEG127);

void setup() {
  setupMidi(13, 10); // Setup the MIDI communication, with an LED on pin 13, and a delay of 10ms after every message.
  delay(1000); // Wait a second...
}

void loop() {
  enc.refresh();
}


Are you sure that you have your encoder wired up correctly? Did you connect one of the data wires to ground instead of the common wire?

Pieter

bakonyip95

#17
Oct 16, 2016, 07:31 pm Last Edit: Oct 16, 2016, 07:50 pm by bakonyip95
I connected my way:


PieterP

Try swapping the orange and red wire, then try swapping the orange and the white wire.
Did you read the directions for connecting the encoder, in step 11?

Quote
If you don't have the datasheet, try connection it to two LEDs (+resistor ! ). Connect the anodes of the LEDs to the +5V of an Arduino or other power supply, connect their cathodes via two resistors to two of the pins of the encoder, and connect the third pin to the ground of the Arduino. Now slowly turn the encoder. LED 1 should light up first, then LED2, then LED1 should go out, and finally LED2 should go out. The order of the LEDs lighting up should be like this: (○ ○) (● ○) (● ●) (○ ●) (○ ○). If this is the case, the common, or C pin of the encoder is the one you connected to the ground. If this is not the case, and the LEDs go on or off simultaneously, swap two wires and try again. (Don't worry, you will eventually find the right pin, there are only 3 possibilities.) The order of pin A and B doesn't matter.
Pieter

bakonyip95

#19
Oct 17, 2016, 12:49 am Last Edit: Oct 17, 2016, 09:39 am by bakonyip95
I tried all three options. Only One of Them Both communicates with the two directions, but It also Increases the value of ...
It has such an encoder:

EC11 Rotary encoder

bakonyip95

Try swapping the orange and red wire, then try swapping the orange and the white wire.
Did you read the directions for connecting the encoder, in step 11?

Pieter
What type of encoder do you use? Can you give me  a link?
Thanks!

PieterP

I'm using encoders that came out of old microwave ovens, so I've no idea what brand/type they are.
I'd recommend that you try the example sketches from the PJRC Rotary Encoder library to make sure that your encoder is working correctly.

Pieter

Go Up