{"id":13768213,"url":"https://github.com/pageauc/waveshare.pantilthat","last_synced_at":"2025-10-07T04:56:55.070Z","repository":{"id":74954784,"uuid":"301568405","full_name":"pageauc/waveshare.pantilthat","owner":"pageauc","description":"Waveshare PanTiltHat python2 and 3 Driver and demo. Uses curl install scripts. One for Demo and Driver and one just for driver.  Demo's scripts support Pimoroni.","archived":false,"fork":false,"pushed_at":"2023-12-22T13:53:52.000Z","size":26,"stargazers_count":6,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-08T17:12:34.295Z","etag":null,"topics":["bcm2835","curl","demo","pantilthat","pimoroni","python","raspberry-pi","waveshare"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pageauc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-05T23:57:48.000Z","updated_at":"2023-12-22T13:22:09.000Z","dependencies_parsed_at":"2024-08-03T16:06:26.222Z","dependency_job_id":null,"html_url":"https://github.com/pageauc/waveshare.pantilthat","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pageauc/waveshare.pantilthat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pageauc%2Fwaveshare.pantilthat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pageauc%2Fwaveshare.pantilthat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pageauc%2Fwaveshare.pantilthat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pageauc%2Fwaveshare.pantilthat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pageauc","download_url":"https://codeload.github.com/pageauc/waveshare.pantilthat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pageauc%2Fwaveshare.pantilthat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278722762,"owners_count":26034461,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bcm2835","curl","demo","pantilthat","pimoroni","python","raspberry-pi","waveshare"],"created_at":"2024-08-03T16:01:18.174Z","updated_at":"2025-10-07T04:56:55.052Z","avatar_url":"https://github.com/pageauc.png","language":"Python","funding_links":[],"categories":["For Details See [Program Features](https://github.com/pageauc/pi-timolo/wiki/Introduction#program-features) and [Wiki Instructions](https://github.com/pageauc/pi-timolo/wiki) and [YouTube Videos](https://www.youtube.com/playlist?list=PLLXJw_uJtQLa11A4qjVpn2D2T0pgfaSG0)"],"sub_categories":[],"readme":"# waveshare.pantilthat\n#### WaveShare pan tilt hat python library class and demo for Raspberry Pi\n\nI [bought](https://www.amazon.com/waveshare-Pan-Tilt-Raspberry-Onboard-Intensity/dp/B07Q5W6P3N/ref=sr_1_1?dchild=1\u0026keywords=waveshare+pan+tilt\u0026qid=1601992264\u0026sr=8-1) \nthe waveshare pan tilt hat for a Raspberry Pi project I was working on.\nI found Assembly tricky but with the help of a [YouTube video](https://www.youtube.com/watch?v=4A7tJ0QH4L4) I got it together.\nI felt the [vendor instructions](https://www.waveshare.com/pan-tilt-hat.htm) and \n[GitHub Repo](https://github.com/waveshare/Pan-Tilt-HAT) were lacking, especially the python class library and sample code.\nI wrote my own python library that is similar to the Pimoroni pan tilt hat operation that uses -90 to +90 values for pan and tilt\npositioning. I also have several Pimoroni pan tilt hats and found support was much better and trouble free. \nHope this can help you with your own projects.  \n\nInstruction assume you are comfortable with SSH and/or Terminal operation and Raspberry Pi OS commands.\n\n## Quick Install\n\nNOTE: Do a Raspberry Pi OS ***sudo apt-get update*** and ***sudo apt-get upgrade*** before curl install.\n\n***Step 1*** With mouse left button, highlight curl command below. Right click mouse in highlighted area and Copy.    \n***Step 2*** On RPI putty SSH or terminal session right click, select paste then Enter to download and run script.\n\n    curl -L https://raw.githubusercontent.com/pageauc/waveshare.pantilthat/main/install.sh | bash\n\nThis will create a /home/pi/waveshare folder and required files for testing the waveshare pantilt hardware\n \ncurl command below will just install Waveshare python pantilthat library and driver.\n\n    curl -L https://raw.githubusercontent.com/pageauc/waveshare.pantilthat/main/install-driver.sh | bash \n    \nSee script instructions for Details    \n \n## Instructions\n \nThe ***pantilthat.py*** file is the python class library for waveshare pan tilt hat hardware.\nThis driver uses BCM2835 and I2C. For Details See http://www.airspayce.com/mikem/bcm2835/\n\nYou also need to ***enable I2C***    \nFrom a Logged in SSH or Terminal session on the Raspbery Pi. Run the\nRaspberry PI configuration whiptail menu per command below\n\n    sudo raspi-config\n    \nSelect ***5 Interfacing Options*** menu pick            \nSelect ***P5 I2C*** and Enable automatic loading of I2C kernel module\n\nIf you have a Pi camera module installed        \nSelect ***Pi Camera*** and Enable connection to Pi Camera   \n\n***NOTE:*** The test-pantilt.py demo defaults to CAMERA_ON = False\nTo enable use of a Pi Camera edit test-pantilt.py and set variable CAMERA_ON = True\n \nReboot and run the example ***test-pantilt.py*** demo python script per.\n\n    cd ~/waveshare\n    python ./test-pantilt.py\n\nPress ctrl-c to exit script.  \n\nGet the pantilthat to dance. Adapted from the Pimoroni pantilthat Github repo example smooth.py    \nNote Code is compatible with Pimoroni and Waveshare pantilthats under python2 or python3.\n\n    python ./sinwave-dance.py   \n\nReview test-pantilt.py code for implementation details. Code is python2 and python3 compatible.    \nMake a copy and try changing code to learn details of managing pantilt software control.\n\n    cd ~/waveshare\n    cp test-pantilt.py test-myproject.py\n    nano test-myproject.py\n\n### pantilthat.py help() \nBelow is a copy of the pantilthat.py help() function output.       \nExample using python interactive session.\n\n    cd ~/waveshare\n    python\n    from waveshare.pantilthat import PanTilt   # Load from python library dist-packages\n    mypantilt = PanTilt()\n    mypantilt.help()\n\nctrl-d to exit\n\n```\n    pantilthat.py Driver for waveshare pan tilt hat hardware.\n    Modified by Claude Pageau based on original driver at https://github.com/waveshare/Pan-Tilt-HAT\n    This driver uses BCM2835 For Details See http://www.airspayce.com/mikem/bcm2835/\n    Implementation Example\n       from waveshare.pantilthat import PanTilt # import library\n       pantilthat = PanTilt() # Initialize pantilt servo library\n       pantilthat.pan(0)      # valid values -90 to +90 Move pan servo horizontally to center position\n       pantilthat.tilt(-10)   # valid values -90 to +90 Move tilt servo vertically to slightly above center\n    Other Options\n       pantilthat.__version__()   # Display version Number\n       pantilthat.setPWMFreq(50)  # Optional pwm frequency setting\n       pantilthat.setServoPulse(1, 500)  # Optional pwm servo pulse setting\n       pantilthat.debug = True        # Display additional servo information messages\n       pantilthat.flip_servo = False  # Optionally flips pan and tilt in case servo plugin is different\n       pantilthat.stop()   # Turn Off pwm to both servo channels\n       pantilthat.start()  # Turn On pwm to both servo channels after stop\n       pantilthat.help()   # Display this help message\n    Note: currently there is no timeout similar to Pimoroni\n    Bye ...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpageauc%2Fwaveshare.pantilthat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpageauc%2Fwaveshare.pantilthat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpageauc%2Fwaveshare.pantilthat/lists"}