[EthercatDevice_DmpLCD_Generic]
Description
Touchscreen calibration routine for the LCD module on the EtherCAT slave device. This function is a non-blocking function that contains the calibration routine state machine. It must be called continuously until it returns a non-zero value, indicating that the calibration routine is complete.
Derived Class:
Class Name | Vendor ID | Product Code |
EthercatDevice_QECR11UN01 | 0x00000bc3 | 0x0086d103 |
EthercatDevice_QECR00UN01 | 0x00000bc3 | 0x0086d100 |
Syntax
int touchCalibration(int flag = 0);
Parameters
[in] int flag
If the value of this parameter is -1, the current touchscreen calibration routine will be canceled. In this case, the function will return 1 to indicate cancellation. Other values for this parameter have no effect on the calibration routine.
Return Value
Return the current status of the touchscreen calibration routine.
- 0: Calibration in progress.
- 1: Calibration successful.
- -1: Calibration failed.
If the return value is less than 0, it indicates an error code.
Comment
This function must be called after a successful execution of EthercatMaster::begin()
. This function is non-blocking and can be called within the Cyclic Callback.
Example
#include "Ethercat.h" EthercatMaster master; EthercatDevice_QECR00UN01 slave; int rc; void setup() { Serial.begin(115200); master.begin(); slave.attach(0, master); slave.lcdInit(ECAT_LCD_ILI9341_1); while ((rc = slave.touchCalibration()) == 0); if (rc > 0) Serial.println("Touch Screen calibration successful."); else Serial.println("Touch Screen calibration failed."); } void loop() { // ... }
Please see EthercatDevice_DmpLCD_Generic Class for more QEC Stepper Drivers instructions and API usage.