Rotary Encoder Module

(20 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. Sieqck

    buy cabergoline 0.5mg without prescription – purchase cabgolin generic alesse brand

  2. Notrvv

    estrace 1mg price – cheap femara 2.5mg arimidex 1mg ca

  3. Cdvtwq

    バイアグラは薬局で買える? – г‚·г‚ўгѓЄг‚№ гЃЉгЃ™гЃ™г‚Ѓ г‚їгѓЂгѓ©гѓ•г‚Јгѓ«гЃ®йЈІгЃїж–№гЃЁеЉ№жћњ

  4. Rrplxq

    гѓ—гѓ¬гѓ‰гѓ‹гѓігЃ®йЈІгЃїж–№гЃЁеЉ№жћњ – アジスロマイシンの購入 アジスロマイシンの飲み方と効果

  5. Grobend

    priligy dapoxetina 30mg nos eua Once injected in a gel capsule, Deca can be taken orally or parenterally

  6. Lxodzl

    гѓ—гѓ¬гѓ‰гѓ‹гѓійЊ  5 mg еј·гЃ• – イソトレチノイン通販 安全 イソトレチノイン еЂ¤ж®µ

  7. Vyqgcx

    eriacta accept – apcalis cover forzest jar

  8. Ygdhqf

    indinavir brand – cheap generic confido order diclofenac gel for sale

  9. Xbjnht

    valif online onto – valif online prefer buy sinemet 20mg sale

  10. Ankxtm

    buy provigil – cefadroxil usa combivir online buy

  11. Gjtysb

    buy generic phenergan – cost lincocin 500 mg lincocin 500mg without prescription

  12. Spevdq

    stromectol 3mg – carbamazepine 200mg over the counter tegretol pills

  13. Ubyaif

    order prednisone 5mg generic – nateglinide 120 mg brand order capoten 25mg without prescription

  14. Wwudpg

    deltasone over the counter – nateglinide 120 mg pill cost capoten

  15. Wbtylw

    buy isotretinoin 40mg pills – order zyvox 600 mg for sale buy linezolid 600mg sale

  16. Hnhvhe

    order amoxicillin online – amoxil over the counter buy combivent

  17. Ebkskh

    buy azithromycin no prescription – order tinidazole sale brand bystolic

  18. Dcyfuy

    omnacortil 20mg pill – order azipro 500mg generic purchase prometrium pill

  19. Qopxdq

    order lasix 40mg online – nootropil for sale betnovate 20gm brand

  20. Zefseb

    vibra-tabs usa – order glipizide cost glipizide 10mg

Add a review

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