indexRead()

説明

Zピンの電位をフィードバックします。この関数がPulse/DIR、CW/CCW、A/B Pulseモードにしか使えないです。

語法


Enc0.indexRead()
Enc1.indexRead()
Enc2.indexRead()
Enc3.indexRead()

変数

フィードバック

LOW 或いは HIGH

#include <Encoder.h>

void setup() {
  Serial.begin(9600);
  Enc0.begin(MODE_AB_PHASE);
}

void loop() {
  Serial.println(Enc0.indexRead()); // Zピンの電位をプリントアウトします
  delay(100);
}

See also

begin()
setIndexReset()


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 public domain.