Giter VIP home page Giter VIP logo

pantilt's Introduction

PanTilt

How to use PanTilt library:

1. Import the library

from libCH.pantilt import PanTilt

2. Create PanTilt object, first parameter is the pin number of PAN servo, the second is Tilt pin number

motorPT = PanTilt(12,11)

3. Start to send PWM to PAN/Tilt servos(you will hear that the motor is turning)

motorPT.start()

4. Move right (or left) for X length ( 1 is about 18 degrees, if you want to turn right for 90 degrees,

the value for the parameter is 90, if you want to turn left for 90 degrees, the value is -90)

motorPT.movePAN(X)

5. Turn up or down for Y length ( 1 is about 18 degrees, if you want to move up for 10 degrees,

the value for the parameter is 0.56, if you want to turn down for 90 degrees, the value is -90)

motorPT.moveTILT(Y)

6. Turn right(or left) to xDegree position( xDegree's range is 2.512.5, corresponding to 0180 degree,

so, if the value for the parameter is 7.5, the servoo will turn to center position(90 degree))

motorPT.movePAN(xDegree)

7. Turn up(or down) to the yDegree position( yDegree's range is 2.512.5, corresponding to 0180 degree,

so, if the value for the parameter is 7.5, the servoo will turn to center position(90 degree))

motorPT.moveTILT(xDegree)

8. Stop sending PWM to Pan/Tilt (The servos of PAN/TILT will be stopped)

motorPT.stop()

pantilt's People

Contributors

ch-tseng avatar

Stargazers

 avatar  avatar Arthur Wu avatar  avatar  avatar BTJun avatar lll avatar ZERO-A-ONE avatar 生活满是幸福 avatar elseane avatar Bouseng avatar Bobby Chen avatar Bobby Chen avatar  avatar

Watchers

elseane avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.