360 Grad PWM Rotary Encoder Breakout

360 Grad 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.

  • Beschreibung

    Dieser Schaltertyp ist ein inkrementeller Rotary -Encoder. Tatsächlich ist es aufgrund seiner geringen Kosten und der Fähigkeit, Signale bereitzustellen, die leicht interpretiert werden können, um bewegungsbezogene Informationen wie Geschwindigkeit bereitzustellen.

    Durch das Drehen kann der Drehcodierer die Ausgangsimpulsfrequenz in positiver und umgekehrter Richtung während der Drehung zählen, im Gegensatz zu einem Rotary Potentiometer -Zähler ohne Grenzbeschränkung. Mit der Taste im Rotary -Encoder kann er ab Null auf den Ausgangszustand zurückgesetzt werden.

  • Testcode

    int rotpin = 2;
    int gelbpin = 3;
    int greenpin = 4;
    int apin = 6;
    int bpin = 7;
    int buttonpin = 5;
    int state = 0;
    int longperiod = 5000; // Zeit bei grün oder rot
    int Shortperiod = 700; // Zeitraum beim Ändern
    int targetCount = Shortperiod;
    int count = 0;
    void setup ()
    {
      pinMode (apin, Eingabe);
      PinMode (BPIN, Eingabe);
      PinMode (ButtonPin, Eingabe);
      PinMode (Redpin, Ausgang);
      PinMode (Yellowpin, Ausgang);
      PinMode (GreenPin, Ausgang);
    }
    Hohlraumschleife ()
    {
      zählen ++;
      if (digitalread (buttonpin))
      {
      setlights (hoch, hoch, hoch);
      }
      anders
      {
      int change = GetEnCoderturn ();
      int NewPeriod = longperiod + (Änderung * 1000);  
      if (newPeriod> = 1000 && newPeriod <= 10000)
        {
      longperiod = newperiod;
        }
      if (count> targetCount)
        {
      setState ();
      count = 0;
        }
      }
      Verzögerung (1);
    }
    int GordeCoderturn ()
    {

     // Return -1, 0 oder +1 zurückgeben
      statische int olda = niedrig;
      static int oldb = niedrig;
      int result = 0;
      int newa = digitalread (apin);
      int newb = digitalread (BPIN);
      if (newa! = Olda || neu! = Oldb)
      {
      // etwas hat sich verändert
      if (olda == low && newa == hoch)
        {
      Ergebnis = - (Oldb * 2 - 1);
        }
      }
      Olda = Newa;
      Oldb = Neuling;
      Rückgabeergebnis;
    }
    int setState ()
      {
      if (Zustand == 0)
        {
      SetLights (hoch, niedrig, niedrig);
      targetCount = longperiod;
      Zustand = 1;
        }
      sonst wenn (Zustand == 1)
        {
      setlights (hoch, hoch, niedrig);
      targetCount = Shortperiod;
      Zustand = 2;
        }
      sonst wenn (Zustand == 2)
        {
      Setlights (niedrig, niedrig, hoch);
      targetCount = longperiod;
      Zustand = 3;
        }
      sonst wenn (Zustand == 3)
        {
      SetLights (niedrig, hoch, niedrig);
      targetCount = Shortperiod;
      Zustand = 0;
        }
      }
    Hohlräume (int rot, int gelb, int grün)
    {
      DigitalWrite (Redpin, rot);
      DigitalWrite (Yellowpin, Gelb);
      DigitalWrite (GreenPin, Green);

Frequently Bought Together

Total Price: $0.00 USD