شکستن رمزگذار روتاری 360 درجه PWM

شکستن رمزگذار روتاری 360 درجه PWM

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

  • شرح

    این نوع سوئیچ یک رمزگذار چرخشی افزایشی است. در واقع ، این بیشترین استفاده از همه رمزگذارهای دوار به دلیل کم هزینه و توانایی ارائه سیگنالهایی است که می توان به راحتی تفسیر کرد تا اطلاعات مربوط به حرکت مانند سرعت را ارائه دهد.

    با چرخاندن ، رمزگذار چرخشی می تواند بر خلاف یک پیشخوان پتانسیومتر چرخشی بدون محدودیت شمارش ، فرکانس پالس خروجی را در جهت مثبت و معکوس در طول چرخش حساب کند. با استفاده از دکمه روی رمزگذار دوار ، می توان دوباره به حالت اولیه آن از صفر تنظیم شد.

  • رمز آزمایش

    int redpin = 2 ؛
    int yellowpin = 3 ؛
    int greenpin = 4 ؛
    int apin = 6 ؛
    int bpin = 7 ؛
    int buttonpin = 5 ؛
    int state = 0 ؛
    int longperiod = 5000 ؛ // زمان در سبز یا قرمز
    int shortperiod = 700 ؛ // دوره زمانی هنگام تغییر
    int targetCount = ShortPeriod ؛
    int count = 0 ؛
    تنظیم باطل ()
    {
      pinmode (apin ، input) ؛
      pinmode (bpin ، ورودی) ؛
      pinmode (دکمه pin ، ورودی) ؛
      pinmode (redpin ، خروجی) ؛
      pinmode (yellowpin ، خروجی) ؛
      pinmode (گرینپین ، خروجی) ؛
    }
    حلقه باطل ()
    {
      تعداد ++ ؛
      if (DigitalRead (ButtonPin))
      {
      Setlights (بالا ، بالا ، بالا) ؛
      }
      دیگر
      {
      int change = getEncoderTurn () ؛
      int newperiod = longperiod + (تغییر * 1000) ؛  
      if (newperiod> = 1000 && newperiod <= 10000)
        {
      longperiod = newperiod ؛
        }
      if (count> targetcount)
        {
      setState () ؛
      تعداد = 0 ؛
        }
      }
      تأخیر (1) ؛
    }
    int getEncoderTurn ()
    {

     // بازگشت -1 ، 0 یا +1
      static int olda = کم ؛
      static int oldb = کم ؛
      نتیجه int = 0 ؛
      int newa = DigitalRead (apin) ؛
      int newb = DigitalRead (BPIN) ؛
      if (newa! = olda || newb! = oldB)
      {
      // چیزی تغییر کرده است
      if (olda == low && newa == high)
        {
      نتیجه = - (oldb * 2 - 1) ؛
        }
      }
      olda = newa ؛
      oldb = newb ؛
      نتیجه بازگشت ؛
    }
    int setState ()
      {
      if (حالت == 0)
        {
      Setlights (بالا ، پایین ، کم) ؛
      TargetCount = Longperiod ؛
      حالت = 1 ؛
        }
      دیگری اگر (حالت == 1)
        {
      Setlights (بالا ، بالا ، پایین) ؛
      TargetCount = ShortPeriod ؛
      حالت = 2 ؛
        }
      دیگری اگر (حالت == 2)
        {
      Setlights (کم ، کم ، زیاد) ؛
      TargetCount = Longperiod ؛
      حالت = 3 ؛
        }
      دیگری اگر (حالت == 3)
        {
      Setlights (کم ، زیاد ، کم) ؛
      TargetCount = ShortPeriod ؛
      حالت = 0 ؛
        }
      }
    void setlights (int red ، int yellow ، int green)
    {
      DigitalWrite (redpin ، قرمز) ؛
      DigitalWrite (Yellowpin ، Yellow) ؛
      DigitalWrite (گرینپین ، سبز) ؛

Frequently Bought Together

Total Price: $0.00 USD