Egr 103 - Code For Project
Egr 103 - Code For Project
%print results
else
fprintf('All SYSTEMS GO!!! \n Inital test opacity: %d
\n Initial test reflectivity: %d \n', getBaselineOpacity,
getBaselineReflectivity);
end
%obtain intruction
promptTwo = 'Type 1 to run program. Type 2 to end. Type
3 for a summary of results. Type 0 to test.';
instructionTwo = input(promptTwo, 's');
end
%execute instruction
for (i = 0:7)
%run program
pause(1) %pause
%move pulley
pause(2)
pause (2)
fprintf('testOpacity: %d \n testReflectivity: %d \n
Identity: cloth \n', testOpacity, testReflectivity) %print
results
%move pulley
pause (2)
fprintf('testOpacity: %d \n testReflectivity: %d \n
Identity: Steel \n', testOpacity, testReflectivity) %print
results
%move pulley
writePosition(s1, 1.0) %move servo 1
writePosition(s2, 0.0) %move servo 2
fprintf('testOpacity: %d \n testReflectivity: %d \n
Identity: Aluminum \n', testOpacity, testReflectivity);
%print results
%move pulley
end
fprintf('testOpacity: %d \n testReflectivity: %d \n
Identity: paper \n', testOpacity, testReflectivity) %print
results
%move pulley
writePosition(s1, 0.6) %move servo 1
writePosition(s2, 0.0) %move servo 2
else
fprintf('ERROR with sensor!!! \n') %print that there is
an error if the chip doesnt appear to be anything
end
%obtain instruction
%promptOne = 'Type number of chips (use numbers not
letters): ';
%numChips = input (promptOne, 's');
end
%obtain instruction
promptTwo = 'Type 3 for a summary of results.';
instructionTwo = input(promptTwo, 's');
end
%execute instruction
while instructionTwo == ('3')
end