サイト内検索

検索

Shares

Table of Content

EthercatDevice_DmpHID.lcmWrite()

[EthercatDevice_DmpHID_Generic]

説明

EtherCATスレーブデバイスのLCM画面に 1文字を出力します。

派生クラス:

クラス名製造者ID製品コードUARTKeypadLCMMPG
EthercatDevice_QECR11HU9S0x00000bc30x0086d402OOOO
EthercatDevice_QECR00HU9S0x00000bc30x0086d401OOOO

構文

int lcmWrite(char c);

媒介変数

  • [in] char c
    LCM 画面に出力される文字。

戻り値

LCM画面に出力される文字数を返します。戻り値が0より小さい場合、 error codeを示します。.

備考

この関数は、 EthercatMaster::begin()が正常に実行された後に呼び出す必要があります。この関数はブロッキングされていないため、循環コールバック内で呼び出すことができます。

#include "Ethercat.h"

EthercatMaster master;
EthercatDevice_QECR11HU9S slave;

void CyclicCallback() {
  slave.update();
}

void setup() {
  master.begin();
  slave.attach(0, master);
  master.attachCyclicCallback(CyclicCallback);
  master.start();

  slave.lcmWrite('H');
  slave.lcmWrite('e');
  slave.lcmWrite('l');
  slave.lcmWrite('l');
  slave.lcmWrite('o');
  slave.lcmWrite('!');
}

void loop() {
  // ...
}

Please see EthercatDevice_DmpHID_Generic Class for more QEC HID slave instructions and API usage.

上部へスクロール