[EthercatDevice_XXX]
描述
寫入從站的 Output PDO。(unit8_t)
格式
int pdoWrite8(uint16_t offset, uint8_t value);
語法
EthercatDevice_XXX slave;
slave.pdoWrite8();
參數
uint16_t offset
:PDO 的內存地址。uint8_t value
:: 1-byte 的數據。
回傳
Int:0表示成功;如果返回值小於0表示錯誤。
範例
#include "Ethercat.h" EthercatMaster master; EthercatDevice_Generic slave; void setup() { Serial.begin(115200); master.begin(); slave.attach(0, master); master.start(); } void loop() { /* Write value of byte offset 0 of slave's output process data. */ slave.pdoWrite8(0, 0xFF); /* Read value of byte offset 0 of slave's input process data. */ Serial.println(slave.pdoRead8(0), HEX); delay(100); }
函式庫參考主頁面
86Duino 參考的文本是根據 Creative Commons Attribution-ShareAlike 3.0 License,部分文本是從 the Arduino reference 修改的。 參考中的代碼示例已發佈到公共領域。