Articles Posted by the Author:

  • pulseInNanoseconds()

    pulseInNanoseconds()

    Description This function is similar to the pulseIn() function, returns value in nano-second (ns) and limite the maximum pulse width to 4.2 seconds. Note: This function is designed to work in the PWM pulse width capture mode. This function cannot be used in conjunction with the encoder library’s attachInterrupt(). After calling attachInterrupt() and mount ISR, […]


  • setInputPolarity()

    setInputPolarity()

    Description Set signal polarity for pin A, B and Z, such as: Under the Pulse/DIR mode, set pin A polarity to LOW, which configure the system to interpret the low voltage condition for pin A as signal HIGH and high voltage condition for the pin as signal LOW. This function is valid under the Pulse/DIR, […]


  • setDigitalFilter()

    setDigitalFilter()

    Description Set digital filter function on pin A, B and Z, to filter noise within a specified range. Note: In the pulse capture mode, this function can only be used prior to the attachInterrupt(), pulseIn() and pulseInNanoseconds() function within the Encoder library. Syntax Enc0.setDigitalFilter(val) Enc1.setDigitalFilter(val) Enc2.setDigitalFilter(val) Enc3.setDigitalFilter(val) Parameters Enc0、Enc1、Enc2、Enc3:Corresponding to ENC0, ENC1, ENC2 and ENC3 […]


  • setIndexReset()

    setIndexReset()

    Description Set an associated interrupt event to reset the index (when pin Z from the encoder interface go HIGH, it trigger the interrupt). This function can be use under the Pulse/DIR, CW/CCW and A/B Pulse modes. Attention: Calling this function trigger index reset (when pin Z changes to HIGH), and set encoder’s counter value to […]


  • setComparator()

    setComparator()

    Description Set the counter value to trigger interrupt. When the encoder’s counter value reach this value, it trigger an interrupt event and reset the counter. This function can only be use in the Pulse/DIR, CW/CCW and A/B Pulse modes. Syntax Enc0.setComparator(val) Enc0.setComparator(val, condition) Enc1.setComparator(val) Enc1.setComparator(val, condition) Enc2.setComparator(val) Enc2.setComparator(val, condition) Enc3.setComparator(val) Enc3.setComparator(val, condition) Parameters Enc0、Enc1、Enc2、Enc3:Corresponding to […]


  • detachInterrupt()

    detachInterrupt()

    Description Detach interrupt service to encoder interface. Syntax Enc0.detachInterrupt() Enc1.detachInterrupt() Enc2.detachInterrupt() Enc3.detachInterrupt() Parameters Enc0、Enc1、Enc2、Enc3:Corresponding to ENC0, ENC1, ENC2 and ENC3 encoder interfaces. Returns None See also - attachInterrupt() Libraries Reference Home The text of the 86Duino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the […]


  • attachInterrupt()

    attachInterrupt()

    Description Attach interrupt service to encoder interface. Under different operating mode, the condition to trigger interrupt is different: Pulse/DIR, CW/CCW and A/B Pulse mode: index interrupt event (trigger by setIndexReset()), comparator interrupt event (trigger by setComparator()), counter overflow interrupt event (trigger by setRange()), counter underflow interrupt event (trigger by setRange()). PWM pulse capture mode: Pulse […]


  • pulseIn()

    pulseIn()

    Description Read the pulse width value for a designated pin (designated by the pin parameter), during signal HIGH or LOW condition (designated by the state parameter). Pulse width value is the length of time the pin’s voltage remain HIGH or LOW. For example, when the state parameter is set to HIGH, the pulseIn() function wait […]


  • readNanoseconds()

    readNanoseconds()

    Description This function can only be used under PWM Pulse capture mode, similar function as read() with returning variable in nanosecond (ns) for the width of the pulse. Syntax Enc0.readNanoseconds() Enc1.readNanoseconds() Enc2.readNanoseconds() Enc3.readNanoseconds() Parameters Enc0、Enc1、Enc2、Enc3:Corresponding to ENC0, ENC1, ENC2 and ENC3 encoder interfaces. Returns Return width of the pulse in LOW and HIGH condition, where […]


  • indexRead()

    indexRead()

    Description Returns voltage potential for pin Z, this function is designed to work in the Pulse/DIR, CW/CCW and A/B Pulse modes. Syntax Enc0.indexRead() Enc1.indexRead() Enc2.indexRead() Enc3.indexRead() Parameters Enc0、Enc1、Enc2、Enc3:Corresponding to ENC0, ENC1, ENC2 and ENC3 encoder interfaces. Returns LOW or HIGH Example See also - begin() - setIndexReset() Libraries Reference Home The text of the 86Duino […]