Python Syntax Errors in Motorized Focus Camera scripts

Published by peroberts on

Home Forums Cameras Modules for Raspberry Pi 5MP OV5647 V1 Cameras Python Syntax Errors in Motorized Focus Camera scripts

Viewing 2 reply threads
  • Author
    Posts
    • #14268
      peroberts
      Participant

      I downloaded the 3 scripts from github today, extracted them, and ran them in the command line, and this is the result:

      [email protected]:~ $ sudo python Motorized_Focus_Camera_Preview.py
      File “Motorized_Focus_Camera_Preview.py”, line 16
      if event.type ==KEYDOWN:
      ^
      TabError: inconsistent use of tabs and spaces in indentation

      [email protected]:~ $ sudo python Autofocus.py
      Traceback (most recent call last):
      File “Autofocus.py”, line 1, in <module>
      import cv2 #sudo apt-get install python-opencv
      ModuleNotFoundError: No module named ‘cv2’

      [email protected]:~ $ sudo python Motorized_Focus_Camera_Snapshot.py
      File “Motorized_Focus_Camera_Snapshot.py”, line 18
      if event.type ==KEYDOWN:
      ^
      TabError: inconsistent use of tabs and spaces in indentation
      [email protected]:~ $

      Can you help me out here? Thanks.

      -Penny

    • #14326
      bin
      Keymaster

      Hi,

      The python code need pygame module, which is not convenient. I have add a C version code just now. Please try to use the new code https://github.com/ArduCAM/RaspberryPi/tree/master/Motorized_Focus_Camera/C

    • #14335
      peroberts
      Participant

      This works perfectly. Thanks!

      • #14336
        bin
        Keymaster

        You are welcome. It is my duty to help you solve your problems.

        Let me know if you need more help.

         

Viewing 2 reply threads
  • You must be logged in to reply to this topic.