EasyCAT LAB - EtherCAT master simple example
Dependencies: SOEM SPI_TFT_ILI9341 TFT_fonts
- This repository contains a simple example for the EasyCAT LAB , a complete educational and experimental EtherCAT® system, composed of one master and two slaves.
- The EasyCAT LAB is provided as a kit by AB&T Tecnologie Informatiche, to allow everybody to have an educational EtherCAT® system up and running in a matter of minutes.
- It uses the SOEM (Simple Open EtherCAT® Master) library by rt-labs, that has been ported in the ecosystem by AB&T Tecnologie Informatiche.
- The slaves are based on the EasyCAT SHIELD and the Arduino UNO.
Note
- This example uses two LAB 2 slaves.
Note
- In this example only two bytes of data are exchanged between the slaves and are also visualized on the TFT display.
Diff: main.cpp
- Revision:
- 4:cbef7fa67d5f
- Parent:
- 3:9c8c179d1f8a
--- a/main.cpp Wed Oct 25 13:44:06 2023 +0000 +++ b/main.cpp Wed Oct 25 14:42:52 2023 +0000 @@ -441,7 +441,7 @@ //----- slave LAB_2_1 data management ------ // - Buttons_1 = in_LAB_2_1->Buttons; // read the buttons status from the slave + Buttons_1 = in_LAB_1->Buttons; // read the buttons status from the slave // if (Buttons_1 != PrevButtons_1) // check if the buttons value has changed { // @@ -449,14 +449,14 @@ DrawButtons_1_Value(Buttons_1); // draw the current buttons value on the TFT } // // - out_LAB_2_1->Segments = Buttons_2; // send to the slave the buttons status + out_LAB_1->Segments = Buttons_2; // send to the slave the buttons status // from the slave LAB_2_2 //----- slave 2_2 data management ---------- // - Buttons_2 = in_LAB_2_2->Buttons; // read the buttons status from the slave + Buttons_2 = in_LAB_2->Buttons; // read the buttons status from the slave // if (Buttons_2 != PrevButtons_2) // check if the buttons value has changed { // @@ -464,7 +464,7 @@ DrawButtons_2_Value(Buttons_2); // draw the current buttons value on the TFT } // // - out_LAB_2_2->Segments = Buttons_1; // send to the slave the buttons status + out_LAB_2->Segments = Buttons_1; // send to the slave the buttons status // from the slave LAB_2_1