This example shows how to build a simple LED blinking application with Waijung 2 from scratch.
This example is orchestrated for a beginner to get accustomed with both Matlab Simulink and Waijung2 blockset.
Create the model file¶
Open Matlab. Change the current folder to the directory where you want to create the model. Click Simulink.
Click Blank Model. Save the new model as 'HelloWorld.slx'.
Open Library Browser. After Waijung 2 installation the Waijung 2 blockset will be available in the Library Browser. You can use the library browser to import Waijung 2 blocks to your workspace. With newer versions of Matlab this can be done more easily by typing the block name on the work surface. This method will be used for the rest of the steps.
Close the Library Browser and double click on the workspace and type Waijung 2 Target Setup .
Similarly add the following blocks to complete the model.
Re-arrange the blocks according to the picture.
Change the block configuration parameters as shown in picture by double clicking on each block.
Connect the hardware¶
Connect an LED to digital pin 5 of your ESP32.
The LED connected to pin5 will start blinking at 0.5 Hz frequency.
Waijung 2 blocks used in this model¶
The following blocks have been used in this model.
Click to download the HelloWorld.slx model file.