Breakout dell'encoder rotante PWM a 360 gradi

Breakout dell'encoder rotante PWM a 360 gradi

$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.

  • Descrizione

    Questo tipo di interruttore è un encoder rotante incrementale. È un dato di fatto, è il più utilizzato di tutti gli encoder rotanti a causa del suo basso costo e della capacità di fornire segnali che possono essere facilmente interpretati per fornire informazioni relative al movimento come la velocità.

    Ruotando, l'encoder rotante può contare la frequenza dell'impulso di uscita in direzione positiva e inversa durante la rotazione, a differenza di un contatore del potenziometro rotante senza contare la limitazione. Con il pulsante sull'encoder rotante, può essere ripristinato allo stato iniziale a partire da zero.

  • Codice di test

    int RedPin = 2;
    int YellowPin = 3;
    int greenpin = 4;
    int apin = 6;
    int bpin = 7;
    int bottonPin = 5;
    int stato = 0;
    int longperiod = 5000; // Tempo a verde o rosso
    int stivalette = 700; // periodo di tempo in cui si cambia
    int targetCount = ShortPeriod;
    int count = 0;
    void setup ()
    {
      pinMode (apin, ingresso);
      pinMode (bpin, ingresso);
      pinMode (bottonpin, input);
      pinMode (Redpin, output);
      pinMode (YellowPin, output);
      pinMode (GreenPin, output);
    }
    void loop ()
    {
      conta ++;
      if (DigitalRead (ButtonPin))
      {
      set luci (alti, alti, alti);
      }
      altro
      {
      int change = getenCoderturn ();
      int newperiod = longperiod + (cambio * 1000);  
      if (Newperiod> = 1000 && NewPeriod <= 10000)
        {
      longperiod = newperiod;
        }
      if (Count> TargetCount)
        {
      setState ();
      conta = 0;
        }
      }
      ritardo (1);
    }
    int getEnCoderturn ()
    {

     // return -1, 0 o +1
      statico int vecchio = basso;
      static int oldb = basso;
      int risultato = 0;
      int newA = DigitalRead (apin);
      int newB = DigitalRead (BPIN);
      if (newa! = oldA || newb! = oldb)
      {
      // qualcosa è cambiato
      if (oldA == Low && newa == High)
        {
      risultato = - (oldb * 2 - 1);
        }
      }
      OldA = newa;
      oldb = newb;
      risultato di ritorno;
    }
    int setState ()
      {
      if (stato == 0)
        {
      set luci (alti, bassi, bassi);
      TargetCount = LongPeriod;
      stato = 1;
        }
      else if (stato == 1)
        {
      setlight (alti, alti, bassi);
      TargetCount = ShortPeriod;
      stato = 2;
        }
      altrimenti if (stato == 2)
        {
      set luci (bassi, bassi, alti);
      TargetCount = LongPeriod;
      stato = 3;
        }
      else if (stato == 3)
        {
      set luci (bassi, alti, bassi);
      TargetCount = ShortPeriod;
      stato = 0;
        }
      }
    set luci void (int rosso, int giallo, int verde)
    {
      DigitalWrite (RedPin, Red);
      DigitalWrite (YellowPin, Yellow);
      DigitalWrite (GreenPin, Green);

Frequently Bought Together

Total Price: $0.00 USD