%h=initcom(5,115200);

ang_max_tilt=30;
ang_min_tilt=-60;

ang_max_pan=90;
ang_min_pan=-90;
velocidade=1
pause_time=1
applyjoint(h,4,3,[1 1 1])
applyjoint(h,4,1,[velocidade velocidade velocidade])

applyjoint(h,4,0,[10 0 0])
pause(pause_time);

i=0;
while(i<3)
applyjoint(h,4,0,[ang_max_tilt 0 0])
pause(pause_time);
applyjoint(h,4,0,[ang_min_tilt 0 0])
pause(pause_time);
applyjoint(h,4,0,[10 0 0])
pause(pause_time);
applyjoint(h,4,0,[0 ang_max_pan 0])
pause(pause_time);
applyjoint(h,4,0,[0 ang_min_pan 0])
pause(pause_time);
applyjoint(h,4,0,[10 0 0])
pause(pause_time);

i=1+1

end

applyjoint(h,4,3,[0 0 0])

killcom(h)

