npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pan-tilt-hat

v1.2.1

Published

Pimoroni Pan Tilt HAT for NodeJS

Downloads

90

Readme

Node Pan-Tilt HAT library (c) 2017, 2018 Roger Hardiman

This library provides an easy way for NodeJS applications to use the Raspberry Pi Pan-Tilt HAT (made by Pimoroni) with the AdaFruit Pan/Tilt assembly. It spawns a background Python process to communicate with the Pan-Tilt HAT and this Python process make use of Pimoroni's Python libraries. You must install Python and install the Pimoroni Pan-Tilt HAT Python libraries before using this code.

Use the close() function to close the spawned Python process. There was a design decision to keep the Python process running to avoid the overhead (and latency) caused by stopping and starting the Python script every time the camera has to move.

This library provides the following APIs

  1. Pimoroni API The library impements pan(angle) - pan angle is -90..+90 servo_one(angle) - pan angle is -90..+90 tilt(angle) - tilt angle is -80..+80 servo_two(angle) - tilt angle is -80..+80 goto_home() - Set Pan to 0 and Tilt to 0

  2. Continual Move API The API is based on analogue CCTV systems where a command will start the pan or tilt motors moving and the motors will continue to move until a stop() command is issued. The API commands are pan_left(speed) - speed range is 0..15 pan_right(speed) - speed range is 0..15 tilt_up(speed) - speed range is 0..15 tilt_down(speed) - speed range is 0..15 stop() The library updates the pan and tilt position 10 times per second

  3. An Exit API close() - used to close the spawned Python worker process and to stop an internal timer to allow NodeJS to terminate.

Applications

The library is being used in the Raspbery Pi ONVIF Server project (RPOS) that turns a Pi + Pi Camera + Pan-Tilt HAT + AdaFruit Pan/Tilt assembly into an ONVIF Profile S CCTV Camera.