To bring the DigitalWrite
system object into Simulink®,
follow the steps:
Create a new Simulink model.
From the User Defined Functions library, add the MATLAB System block to the model.
In the block, set System object name to DigitalWrite
.
From the Sources library, add the Pulse Generator block to the model.
From the Signal Attributes library, add the Data Type Conversion block to the model.
Connect the blocks as shown.
In the next section, you will Generate Code and Deploy the Model to the Hardware containing your system object.
Create a Digital Write Block | Generate Code and Deploy the Model to the Hardware | Implement a MATLAB System Block | Test System Object on MATLAB Command Line