I run this code on Python 3 but it gives an error on echo 0, and echo 1.

Can any one can correct this?

#go to starting possition
echo 0=60 > /dev/servoblaster
sleep 1
echo 1=135 > /dev/servoblaster
sleep 1
raspistill -o step1.jpg

echo 0=240 > /dev/servoblaster
sleep 1
raspistill -o step2.jpg

echo 0=130 > /dev/servoblaster
sleep 1
raspistill -o step3.jpg

echo 0=60 > /dev/servoblaster
sleep 1
echo 1=60 > /dev/servoblaster
sleep 1
raspistill -o step4.jpg

echo 1=140 > /dev/servoblaster
sleep 1
raspistill -o step5.jpg

echo 1=220 > /dev/servoblaster
sleep 1
raspistill -o step6.jpg

echo 1=135 > /dev/servoblaster
sleep 1
raspistill -o step7.jpg
  • 1
    Could you cut&paste the text you enter and the error response? – joan Aug 17 '17 at 13:12

This is not python, it's a bash script.

I am not sure what the file's name is, but on the command line you should run:

sudo chmod +x FILENAME
sudo sh FILENAME

And that should run it...

| improve this answer | |
  • Why to run the script with sudo? – Ingo Jan 28 at 9:05
  • You need to run it as an admin. If it works without it great, but my go-to on RaspPi's is to use sudo – Quintin Balsdon Jan 28 at 11:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.