You are on page 1of 6

Zain Nadeem 23100049

Lab 2

1.1: Why did an error occur when implementing the transfer function in example 3?

The transfer function in example 3 is an improper function (the degree of the numerator is higher

than the denominator). Simulink does not implement improper transfer functions.

Task 1: Simulink Model + Output on Scope

Output after executing plot(out.tout, out.ScopeData(: , 2)) command:


Zain Nadeem 23100049

Task 2: creating and running a simple Simulink model on the Arduino Mega 2560 board to light

up a LED.

Simulink Model:

Output of model on Scope:


Zain Nadeem 23100049

LED (blinks every second) connected to Arduino Mega 2560:

Task 3: We check the analog input (provided by an external oscilloscope) of the Arduino Mega

2560 by displaying the output of the below Simulink model on the Scope.

Simulink Model:
Zain Nadeem 23100049

Output on Scope with gain = 5/1024: -

Task 4: We check the digital input (provided by an external oscilloscope) of the Arduino Mega

2560 by displaying the output of the below Simulink model on the Scope.

Simulink Model + Output:


Zain Nadeem 23100049

Task 5: We check the analog output of the Arduino Mega 2560 by first smoothing the output

waveform of the below Simulink model using a low-pass RC filter and then displaying it using an

external oscilloscope.

Simulink Model:

RC low pass filter: -


Zain Nadeem 23100049

Analog output on an external oscilloscope:

You might also like