Encoder Adapter FIT0324
Part | Datasheet |
---|---|
![]() |
FIT0324 (pdf) |
PDF Datasheet Preview |
---|
Encoder Adapter FIT0324 Contents • 1 Introduction • 2 Specification • 3 Encoder Diagram • 4 Encoder Sample Code Introduction This adapter is especially designed for DFRobot 12V DC Motors. This adapter comprises an external pull-up resistor, which raises the output voltage when the transistor is turned off. This board has two build-in pull-up resistors. Specification • Compatible with open collector output encoder • Size:31x24mm • Hall Sensor 5v Encoder Diagram Diagram for using encoder with Encoder Adapter Encoder Sample Code /* Pay attention to the interrupt pin,please check which microcontroller you use */ //The sample code for driving one way motor encoder const byte encoder0pinA = 2;//A pin -> the interrupt pin 2 const byte encoder0pinB = 4;//B pin -> the digital pin 4 byte encoder0PinALast int duration;//the number of the pulses boolean Direction;//the rotation direction void setup Serial.begin 57600 ;//Initialize the serial port EncoderInit ;//Initialize the module void loop Serial.print "Pulse:" Serial.println duration = 0 delay 100 ; void EncoderInit Direction = true;//default -> Forward pinMode encoder0pinB,INPUT attachInterrupt 0, wheelSpeed, CHANGE ;//int.0 void wheelSpeed int Lstate = digitalRead encoder0pinA if encoder0PinALast == LOW && Lstate==HIGH int val = digitalRead encoder0pinB ; if val == LOW && Direction Direction = false //Reverse else if val == HIGH && !Direction Direction = true //Forward encoder0PinALast = Lstate if !Direction duration++ else duration--; Powered By DFRobot 2008-2016 |
More datasheets: AS5011 DB EASYPOINT | FQD3N60TM | FQD3N60TF | FQU3N60TU | FGPF7N60LSDTU | S-E-25 | 1121 | 232SPS2 | WM8770SIFT/V | WM8770SIFT/RV |
Notice: we do not provide any warranties that information, datasheets, application notes, circuit diagrams, or software stored on this website are up-to-date or error free. The archived FIT0324 Datasheet file may be downloaded here without warranties.