Try to implement LED Blinky on Matter Template Example code.

I want to modify the example code which is provided by Matter SDK and there are several examples are there are Light bulb example code, Light Switch example code and Template code as well. Now I just right now simply wants to understand the code and modify it.


But it very complex to understand the code so can you please provide or explain the basic flow of Template like how it works. 

And also, I want to modify that code want to do some practical's like blink an LED but i did not know exactly where in that code I have to Change.

Please your help will be appreciated. 

  • Hi,

    I recommend taking a look at Adding clusters to Matter application. The part about using the ZAP tool to add clusters and attributes is not relevant for your question, but section 3 and 4 where you modify and add code are.
    The main takeaway is that you have events (in AppEvent) which are added to a queue when they happen. When an event is first in the queue and should be handled, the corresponding handler will be called. For example, you have the ButtonEvent which is added to the app event queue when a button is pressed. When it is time for this event to be handled, the function ButtonEventHandler() is called, where you can add code for what you want to happen when a specific button is pressed.

    And also, I want to modify that code want to do some practical's like blink an LED but i did not know exactly where in that code I have to Change.

    This depends on when you want the LED to blink. If you want it to blink regularly you could create use a timer similar to sFunctionTimer, and then toggle the LED in the callback.

    Best regards,
    Marte

  • Okay first of all I will take understanding of Adding clusters to Matter application and in that particular section 3 and 4.

    I am also wanting to know from you that Can you please give me some reference to get more knowledge about ZAP tool because I want to perform DHT11 Temperature sensor on Matter Light Switch Example code so in that case is there any use of ZAP tool?

  • Hi,

    Yes, you can use the ZAP tool to add devices on endpoints and clusters, so you can use this to add a temperature sensor device. This is what is done in step 2 in the guide I linked to in my previous reply, so I recommend going through that. You can also find some information in our documentation under Matter tools - ZAP tool, and in the official ZCL Advanced Platform documentation.

    Best regards,
    Marte

  • Okay thanks for it.

    Now Basically I want to implement DHT11 Temperature Sensor on Matter Light Switch Example code and for that as you mentioned I followed above steps of ZAP tool as well. But In that I have one doubt that when we select our device in ZAP tool and I want DHT11 Temperature Sensor and in that DHT11 Sensor is not mentioned so now which Sensor I choose from there.

    As you also see above image there are different Sensors like HA Temperature Sensor and all but there is not option of DHT11 Sensor.

  • Hi,

    Device type is not related to the physical sensor. You should select "Matter Temperature Sensor".

    Best regards,
    Marte

Related