360 Derece PWM Rotary Encoder Breakout

360 Derece PWM Rotary Encoder Breakout

$7.81 $7.81 USD
Model #AD-PB928027
Quantity
We have 6 of these in stock We have 6 of these in stock
and you currently have in your cart.
In Stock

Add 

Warranty Plus

Warranty Plus:
Your product will be replaced (including free shipping) with a new one within 12 months of purchase, even if it is damaged due to improper wiring, incorrect usage, a problem in the electrical installation or any other circumstance.

Standard Warranty:
12 month warranty comes with every purchase. Covers malfunctions when it is used within the described conditions/limits.

 +8%  ($0.62) ($0.62)

Shipping Cost Estimator

Note: You must have items in your cart already before you can see the estimated costs to ship your cart. This shipping tool will estimate the total shipping cost for your entire basket.

  • Tanım

    Bu tip anahtar artımlı bir döner kodlayıcıdır. Nitekim, düşük maliyeti ve hız gibi hareketle ilgili bilgileri sağlamak için kolayca yorumlanabilecek sinyaller sağlama yeteneği nedeniyle tüm döner kodlayıcıların en yaygın olarak kullanılanıdır.

    Dönerek, döner kodlayıcı, sayım sınırlaması olmadan döner bir potansiyometre tezgahının aksine, dönüş darbesi frekansını döndürme sırasında pozitif ve ters yönde sayabilir. Döner kodlayıcıdaki düğme ile sıfırdan başlayarak başlangıç ​​durumuna sıfırlanabilir.

  • Test kodu

    int redpin = 2;
    int YellowPin = 3;
    int greenpin = 4;
    int apin = 6;
    int bpin = 7;
    int buttonpin = 5;
    int durumu = 0;
    int longperiod = 5000; // yeşil veya kırmızı zaman zaman
    Int ShortPerioD = 700; // Değiştirirken zaman periyodu
    int TargetCount = ShortPerioD;
    int sayısı = 0;
    void kurulumu ()
    {
      pinmode (apin, giriş);
      Pinmode (BPIN, giriş);
      pinmode (buttonpin, giriş);
      pinmode (Redpin, çıktı);
      pinmode (YellowPin, çıktı);
      pinmode (greenpin, çıktı);
    }
    void loop ()
    {
      sayı ++;
      if (digitalread (buttonpin))
      {
      setlights (yüksek, yüksek, yüksek);
      }
      başka
      {
      int change = getEnCoderTurn ();
      int newPeriod = longperioD + (Değişiklik * 1000);  
      if (newPeriod> = 1000 && newPeriod <= 10000)
        {
      longperiod = newPeriod;
        }
      eğer (sayım> TargetCount)
        {
      setState ();
      sayım = 0;
        }
      }
      gecikme (1);
    }
    int getEnCoderTurn ()
    {

     // dönüş -1, 0 veya +1
      statik int olda = düşük;
      statik int Oldb = düşük;
      int sonuç = 0;
      int newa = digitalRead (apin);
      int newB = digitalRead (bpin);
      if (newa! = Olda || newb! = Oldb)
      {
      // bir şeyler değişti
      if (Olda == düşük && newa == Yüksek)
        {
      sonuç = - (Oldb * 2 - 1);
        }
      }
      Olda = newa;
      OldB = newb;
      dönüş sonucu;
    }
    int setstate ()
      {
      if (durum == 0)
        {
      setlights (yüksek, düşük, düşük);
      TargetCount = longperiod;
      durum = 1;
        }
      else (durum == 1)
        {
      setlights (yüksek, yüksek, düşük);
      TargetCount = ShortPeriod;
      durum = 2;
        }
      else (durum == 2)
        {
      setlights (düşük, düşük, yüksek);
      TargetCount = longperiod;
      durum = 3;
        }
      else (durum == 3)
        {
      setlights (düşük, yüksek, düşük);
      TargetCount = ShortPeriod;
      durum = 0;
        }
      }
    void setlights (int kırmızı, int sarı, int yeşil)
    {
      DigitalWrite (Redpin, kırmızı);
      DigitalWrite (YellowPin, Sarı);
      DigitalWrite (Greenpin, yeşil);

Frequently Bought Together

Total Price: $0.00 USD