ja-jp_commands:plc_timer
文書の過去の版を表示しています。
PLCスタイルタイマ
| コマンド | 動作 |
|---|---|
Iton(id, state, ms) | 入力が設定時間ONであると出力がONになります。 |
Itof(id, state, ms) | 入力がOFFになってから設定時間が経過すると出力がOFFになります。 |
Itpl(id, state, ms) | 入力の立ち上がり時点から設定時間の間出力します。 |
Itmon(id, state, ms) | 実行中に再入力されても延長されない単安定パルスです。 |
Itmr(id, state, ms, reset) | ON時間を積算し、resetで初期化します。 |
IgetTime(id) | 該当タイマの経過時間を返します。 |
IgetState(id) | 該当タイマの出力状態を返します。 |
void loop() { bool run = Ibounce(0, 30); digitalWrite(64, Iton(0, run, 1000)); }
コマンドのプロトタイプ
| 戻り型 | コマンドのプロトタイプ |
|---|---|
bool | Iton(uint8_t timer_id, bool state, unsigned long delayTime) |
bool | Itof(uint8_t timer_id, bool state, unsigned long delayTime) |
bool | Itpl(uint8_t timer_id, bool state, unsigned long delayTime) |
bool | Itmon(uint8_t timer_id, bool state, unsigned long delayTime) |
bool | Itmr(uint8_t timer_id, bool state, unsigned long delayTime, bool reset = false) |
unsigned long | IgetTime(uint8_t timer_id) |
bool | IgetState(uint8_t timer_id) |
これらのコマンドはプログラムを停止しません。毎回のloop()で呼び出し、タイマごとに固有のidを使用してください。
ja-jp_commands/plc_timer.1788785588.txt.gz · 最終更新: by 127.0.0.1
