|
aHR0cDovL2ZyZWVzaGlwLmNvLmty
- ºê·£µå À̸§: WeiKedz
- ±Ù¿ø: CN (Á¤Ç°)
- »ç¿ë¹ý: Rotary Encoder Module
- Àç·á: ÁßÇÕü
- À¯Çü: Áøµ¿ ¼¾¼
- Ãâ·Â: ¾Æ³¯·Î±× ¼¾¼
- ÀÌ·Ð: Rotary Encoder Module
- ¸ðµ¨ ¹øÈ£: Rotary Encoder Module
- ¸ÂÃã °¡´É À¯¹«: ±×·¸½À´Ï´Ù
°øÀå µµ¸Å 10 °³/¸ò ·ÎÅ͸® ¿£ÄÚ´õ ¸ðµâ º®µ¹ ¼¾¼ °³¹ß Dropshipping KY-040
ȸÀüÇÏ´Â ÀÎÄÚ´õ´Â »êÃâ ¸Æ¹Ú ºóµµÀÇ ±³Ã¼ µµÁß ¾ÕÀ¸·Î ±×¸®°í ¹ÝÀü ¹æÇâÀ» ÀÚÀüÇؼ ¼¼¾îÁú ¼ö ÀÖ½À´Ï´Ù,
Ä«¿îÅÍ È¸Àü potentiometer Â÷°è¿Í´Â ´Þ¸®, ÀÌ È¸Àü Ä«¿îÆ®´Â Á¦ÇѵÇÁö ¾Ê½À´Ï´Ù.
¹öÆ°ÀÌÀִ ȸÀüÇÏ´Â ÀÎÄÚ´õ´Â ¸®¼Â Ãʱ⠻óÅ¿¡ ½ÃÀÛÇÏ´Â °è»ê 0.
Led°¡ ******************
ARDUI-NO Å×½ºÆ® ÄÚµå:
Const int interruptA = 0; /Interrupt 0 (ÇÉ 2)
Const int interruptB = 1; / / Interrupt 1 (ÇÉ 3)
Int CLK = 2; /PIN2
Int DAT = 3; / / PIN3
Int ´ÜÃß = 4; / / PIN4
Int LED1 = 5; /PIN5
Int LED2 = 6; / / PIN6
Int Á¶»ç = 0;
Void ¼³Á¤ ()
{
AttachInterrupt (interruptA, rotestateanged, ¶³¾îÁö´Â);
/AttachInterrupt (interruptB, buttonState, ¶³¾îÁö´Â);
PinMode (CLK, ÀÔ·Â);
DigitalWrite (2, ³ôÀº); /Àâ¾Æ ´ç±â±â ³ôÀº Restance
PinMode (DAT, ÀÔ·Â);
DigitalWrite (3, ³ôÀº); /Àâ¾Æ ´ç±â±â ³ôÀº Restance
PinMode (´ÜÃß, ÀÔ·Â);
DigitalWrite (4, ³ôÀº); /Àâ¾Æ ´ç±â±â ³ôÀº Restance
PinMode (LED1, Ãâ·Â);
PinMode (LED2, Ãâ·Â);
Serial.begin (9600);
}
Void ·çÇÁ ()
{
If (! (digitalRead (¹öÆ°)))
{
COUNT = 0;
Serial.println ("STOP COUNT = 0");
DigitalWrite (LED1, ³·Àº);
DigitalWrite (LED2, ³·Àº);
Áö¿¬ (2000);
}
Serial.println (Á¶»ç);
}
/ / -------------------------------------------
Void rotestateanged () /CLK ¶³¾îÁö´Â °æ¿ì DAT Àбâ
{
¸¸¾à¿¡ (digitalRead (DAT)) /DAT = ÃÖ°í°¡ ¾ÕÀ¸·Î ¶§
{
Ä«¿îÆ®;
DigitalWrite (LED1, ³ôÀº);
DigitalWrite (LED2, ³·Àº);
Áö¿¬ (20);
}
DAT = LOW °¡ backroteÀÏ ¶§ ´Ù¸¥//
{
Ä«¿îÆ®;
DigitalWrite (LED2, ³ôÀº);
DigitalWrite (LED1, ³·Àº);
Áö¿¬ (20);
}
}
|
|
|
|
|