Rotary Encoder Module

(14 customer reviews)

$6.95

9 in stock

Description

Rotary Encoder Module Code


/* SETUP

Rotary-Encoder  Arduino
GND      -      D2
+        -      5V
SW       -     
DT       -      D4
CL.K     -      D3
*/
 
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;
}

 

Additional information

Weight 0.009 kg
  1. Hvjwyh

    atorvastatin order online atorvastatin usa buy atorvastatin 20mg

  2. Bbiexx

    buy cheap baycip – buy cheap cephalexin buy augmentin for sale

  3. Dodixs

    purchase ciprofloxacin – ethambutol medication augmentin 1000mg over the counter

  4. Kmxlil

    flagyl price – buy generic amoxil zithromax 500mg without prescription

  5. Yazbvj

    ciplox online buy – buy generic doxycycline erythromycin buy online

  6. Ajyvqo

    order valacyclovir online cheap – order nateglinide 120 mg sale purchase acyclovir

  7. Gtnlii

    ivermectin 3 mg over the counter – cost co-amoxiclav order sumycin generic

  8. Odijsd

    flagyl medication – purchase metronidazole azithromycin 500mg canada

  9. Ddqdqn

    oral ampicillin penicillin for sale cheap amoxil online

  10. Liriaz

    lasix ca – lasix 100mg cost purchase capoten sale

  11. Zczyhd

    cost zidovudine 300mg – irbesartan 150mg price zyloprim cheap

  12. Eftjoq

    glycomet over the counter – generic lincocin 500mg lincomycin 500 mg price

  13. Psykpv

    clozapine medication – quinapril where to buy order pepcid 20mg generic

  14. Rufaze

    seroquel 100mg without prescription – purchase seroquel pills order eskalith generic

Add a review

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