KY-040 Rotary Encoder (WH-040)

KY-040 Rotary Encoder (WH-040)
รหัสสินค้า M2694
หมวดหมู่ Arduino Compatible Board
ราคา 30.00 บาท
น้ำหนัก 10 กรัม
สถานะสินค้า พร้อมส่ง
ลงสินค้า 18 มิ.ย. 2562
อัพเดทล่าสุด 11 มิ.ย. 2568
จำนวน
ชิ้น
หยิบลงตะกร้า
บัตรประชาชน
บุ๊คแบ๊งค์
คุ้มครองโดย LnwPay
 

The Rotary encoder can be counted by rotating forward and reverse direction during rotation of the output pulse frequency.
Unlike counter rotating potentiometer, this rotation counts are not limited.
With the buttons on the rotary encoder can be reset to its initial state, that starts counting from 0.
How it works:
Incremental encoder is a displacement of the rotary pulse signal is converted to a series of digital rotary sensors.
These pulses are used to control angular displacement.
In Eltra angular displacement encoder conversion using a photoelectric scanning principle.
Reading system of alternating light transmitting window and the window is not consisting of radial indexing plate (code wheel) rotating basis, while being an infrared light source vertical irradiation light to the code disk image onto the receiving on the surface.
Receiver is covered with a diffraction grating, which has the same code disk window width.
The receiver’s job is to feel the rotation of the disc resulting changes, and change the light into corresponding electrical changes.
Then the low-level signals up to a higher level, and generates no interference square pulse, which must be processed by electronic circuits.
Reading systems typically employ a differential manner, about the same but the phase difference of the two waveforms different by 180° compared to the signal in order to improve the quality and stability of the output signal.
Reading is then the difference between the two signals formed on the basis, thus eliminating the interference.

Color: Black
Current Type: DC
Output Type: Signal
Compatible Brand: For Arduino
Country of Manufacture: China
Drive Voltage: 5V
Pin pitch: 2.54mm







*

int redPin = 2;
int yellowPin = 3;
int greenPin = 4;
int aPin = 6;
int bPin = 7;
int buttonPin = 5;
int state = 0;
int longPeriod = 5000; // Time at green or red
int shortPeriod = 700; // Time period when changing
int targetCount = shortPeriod;
int count = 0;

void setup() {
pinMode(aPin, INPUT);
pinMode(bPin, INPUT);
pinMode(buttonPin, INPUT);
pinMode(redPin, OUTPUT);
pinMode(yellowPin, OUTPUT);
pinMode(greenPin, OUTPUT);
}
void loop() {
count++;
if (digitalRead(buttonPin)) {
setLights (HIGH, HIGH, HIGH);
} else {
int change = getEncoderTurn ();
int newPeriod = longPeriod + (change * 1000);
if (newPeriod >= 1000 && newPeriod <= 10000) {
longPeriod = newPeriod;
}
if (count> targetCount) {
setState ();
count = 0;
}
}
delay(1);
}
int getEncoderTurn () {
// Return -1, 0, or +1
static int oldA = LOW;
static int oldB = LOW;
int result = 0;
int newA = digitalRead(aPin);
int newB = digitalRead(bPin);
if (newA != oldA || newB != oldB) {
//Something has changed
if (oldA == LOW && newA == HIGH) {
result = - (oldB * 2 - 1);
}
}
oldA = newA;
oldB = newB;
return result;
}
int setState () {
if (state == 0) {
setLights (HIGH, LOW, LOW);
targetCount = longPeriod;
state = 1;
} else if (state == 1) {
setLights (HIGH, HIGH, LOW);
targetCount = shortPeriod;
state = 2;
} else if (state == 2) {
setLights (LOW, LOW, HIGH);
targetCount = longPeriod;
state = 3;
} else if (state == 3) {
setLights (LOW, HIGH, LOW);
targetCount = shortPeriod;
state = 0;
}
}
void setLights (int red, int yellow, int green) {
digitalWrite(redPin, red);
digitalWrite(yellowPin, yellow);
digitalWrite(greenPin, green);
}
*

วิธีการชำระเงิน

ธนาคารกรุงเทพ จำกัด (มหาชน) สาขาบิ๊กซี รามคำแหง สะสมทรัพย์
ธนาคารไทยพาณิชย์ จำกัด (มหาชน) สาขาคลองจั่น ออมทรัพย์
บมจ. ธนาคารกรุงไทย สาขาเดอะมอลล์บางกะปิ ออมทรัพย์
บมจ. ธนาคารกสิกรไทย สาขาโลตัส บางกะปิ ออมทรัพย์
พร้อมเพย์ สาขา- mobile
Scan this!
กิตติ แซ่เอี้ยว
096-xxxxxx-3
Accept All Banks | รับเงินได้จากทุกธนาคาร
  • ค่าธรรมเนียม 3.9% + 11 THB
  • การชำระผ่าน PayPal คุณไม่จำเป็นต้องแจ้งชำระเงิน เนื่องจากระบบจะจัดการให้คุณทันที ที่คุณชำระเงินเสร็จสมบูรณ์

CATEGORY

TRACKCODE

  • ค้นหา
*ใส่ เบอร์มือถือ หรือ email ที่ใช้ในการสั่งซื้อ

CONTACT US

096-898-2243

STATISTICS

หน้าที่เข้าชม5,167,008 ครั้ง
ผู้ชมทั้งหมด1,566,348 ครั้ง
ร้านค้าอัพเดท4 ก.ย. 2568

MEMBER

Join เป็นสมาชิกร้านค้า

ร้านmcucity
ร้านmcucity
/www.mcucity.com/
Join เป็นสมาชิกร้าน
803
สมัครสมาชิกร้านนี้ เพื่อรับสิทธิพิเศษ
ติดตามร้านของเราผ่านแอพได้แล้ววันนี้
  • พิมพ์ “mcucity” ในช่อง Search
  • หรือเข้าจากรายการร้านค้าโปรดของฉัน
พูดคุย-สอบถาม