write()
説明
Pulse/DIR、CW/CCW、A/B Pulse モード:86Duinoカウンターからの数値を設定します。
語法
Enc0.write(number)
Enc1.write(number)
Enc2.write(number)
Enc3.write(number)
変数
Enc0、Enc1、Enc2、Enc3
:ENC0、ENC1、ENC2、ENC3のコーディング インターフェースにマッピングします。
number
:カウンターにての数値を設定します。(unsigned long 類)
フィードバック
なし
例
#include <Encoder.h> void setup() { Serial.begin(9600); Enc0.begin(MODE_AB_PHASE); Enc0.write(200L);// カウンターの数値を200から設定します。 } void loop() { Serial.println(Enc0.read()); delay(100); }
See also
- read()
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.