Untitled

mail@pastecode.io avatar
unknown
matlab
2 years ago
350 B
0
Indexable
Never
function Miniproject

a=arduino('COM7','Uno','Libraries','Servo');
S = servo(a, 'D10', 'MinPulseDuration', 1059*10^-6, 'MaxPulseDuration' ,2180*10^-6);
c = ('D7')
A = 1;
B = 0;

while (B < A)
    if readDigitalpin(a,c)==1
        writePosition(s,1);
        pause(1)

    else
        writePosition(s,0);
        pause(1)
    end
end