Analog-out adaptor for Matrix Membrane Keypad

Analog-out adaptor for Matrix Membrane Keypad

Rotation potentiometer (analog) 10K

Rotation potentiometer (analog) 10K

Rotary Encoder Module

Rotary Encoder Module
$0.99
Availability: In stock
SKU
6970622931829
  • Buy 5 for $0.93 each and save 6%
  • Buy 15 for $0.87 each and save 12%
  • Buy 35 for $0.81 each and save 18%
The rotary encoder module is an angular measuring device. It is used to precisely measure the 24-steps rotation of knob that can turn infinitely (with no end stop like a potentiometer has). The rotary encoder module also has a pushbutton when you press on the axis (like the ones used for navigation on many music controllers).

Arduino sketch:

int val;
int encoder0PinA = 3;
int encoder0PinB = 4;
int encoder0Pos = 0;
int encoder0PinALast = LOW;
int n = LOW;

void setup()
{
pinMode (encoder0PinA,INPUT);
pinMode (encoder0PinB,INPUT);
Serial.begin (9600);
}

void loop()
{
n = digitalRead(encoder0PinA);
if ((encoder0PinALast == LOW) && (n == HIGH)) {
if (digitalRead(encoder0PinB) == LOW)
{

  encoder0Pos--;

  }
  else {
        encoder0Pos++;
  }
Serial.print (encoder0Pos);
Serial.print ("/");
}
encoder0PinALast = n;
}
Write Your Own Review
Only registered users can write reviews. Please Sign in or create an account
Fill in your delivery details to check available shipping options and calculate rates for this product. Total delivery fee for your order, you can find in cart.