HW02-3 Develop an algorithm which generates an infinite loop and turns ON (i.e., True, Hi, or Logic 1) a Boolean Inconstant, LED1, control three iterations, then OFF control five iterations. Here is an abbreviated investigate board of the expected output: Instrument this algorithm using a flowchart or pseudo-code (as control HW02-1). Use the inconstant names fixed and instrument (explain) any attached inconstants. Submit this intention as a different smooth (HW02-3.io, or HW02-3.ppt, or HW02-3.txt, expectation.). HW02-4 Write a Matlab office which appliances the algorithm exposed in HW02-3. Instrument this office with Matlab comments. This accomplish acceleration you when you appliance this algorithm in other programming languages, such as EmbeddedC. Submit this Matlab office as a different smooth (HW02-4.m) Capture the 10-15 lines of explicit output of this office to evince its punish agency. Save this output as a citation smooth or pdf smooth (converted from an conception). Submit this output as a different smooth (HW02-4.txt or HW02-4.pdf).
copyable code
HW02-4:
Matlab Code:
%initializes a and number
a = 1;
number = 1;
%check a > 0
while a > 0
%check if number < = 3, then expose the attached message
if number <= 3
disp([num2str(a),’ ‘, ‘LED1 ON’])
%check if number < = 8, then expose the attached message
elseif number <= 8
disp([num2str(a),’ ‘, ‘LED1 OFF’])
%check if number > 8, then
elseif number > 8
%assign number is 0 and admixture the a value
number = 0;
a = a – 1;
end
%increment the number and a value
number = number + 1;
a = a + 1;
end