18, Feb, 2019

rotary encoder lpd3806 400bm g5 24c connections and arduino program

rotary encoder lpd3806 400bm g5 24c connection

Yellow/White = A phase

Blue = B phase

Red =Vcc power +

Black = power –

rotary encoder lpd3806 400bm g5 24c connections and arduino program

ARDUINO CODE FOR lpd3806 400bm g5 24c

#include <Encoder.h>

Encoder myEnc(2, 3);

long relaypoint=0;
void setup() {
  Serial.begin(9600);
  Serial.println(“Encoder Test:”);
}

long oldPosition  = 0;

void loop()
{
  long newPosition = myEnc.read();
  while (newPosition != oldPosition)  

  {
    oldPosition = newPosition;
    relaypoint++;
    Serial.println(relaypoint);
  }
}

download arduino library from https://drive.google.com/file/d/0B-H_CXR7-MD9WG5GS3dHWExVRDQ/view?usp=sharing

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>