Hello world


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

Step 1

Open Matlab. Change the current folder to the directory where you want to create the model. Click Simulink.

Step 2

Click Blank Model. Save the new model as 'HelloWorld.slx'.

Step 3

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.

Step 4

Close the Library Browser and double click on the workspace and type Waijung 2 Target Setup .

Step 5

Similarly add the following blocks to complete the model.


Step 6

Re-arrange the blocks according to the picture.

Step 7

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.

Target Setup Block
Digital Output Block

Simulink model

Click to download the HelloWorld.slx model file.

Also available in: PDF HTML TXT