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

qtouch

v0.0.3

Published

interaction with qtouch component : AT42QT1070 Touch Sensor IC

Downloads

26

Readme

Qtouch : AT42QT1070 Touch Sensor IC

In English

description:

nodejs QTouch library for component AT42QT1070 using the I2C bus on a raspberry pi B. This component is a capacitive touch sensor that is used as a button. This component connects to the I2C bus raspberry pi series b.This library provides interfaces that can read the I2C bus component, to detect different pressing the sensor (see examples). To run the component must:

  • Enable the I2C bus
  • Install the i2c-tools program
  • Download this librairy via npm and nodejs link to your project

activate the I2C bus: http://skpang.co.uk/blog/archives/575 http://innovelectronique.fr/2013/03/02/utilisation-du-bus-i2c-sur-raspberrypi/

install i2c-tools tool:

sudo apt-get install i2c-tool

Download this librairy via npm and nodejs link to your project

npm install qtouch

and in your project:

var qtouch = require("qtouch");

En Francais

###description: librairie nodejs pour le composant qtouch AT42QT1070 utilisant le bus I2C sur un raspberry pi B. Ce composant est un capteur tactile capacitif qui s'utilise comme un bouton. Ce composant se branche sur le bus I2C du raspberry pi serie B.Cette librairie met à disposition des interfaces qui permet de lire le bus I2C du composant, de detecter differents appui sur le capteur (voir les exemples). Pour faire marcher le composant il faut :

  • activer le bus I2C
  • installer le programme i2c-tools
  • telecharger cette librairy via npm et la lier à votre projet nodejs

activer le bus I2C : http://skpang.co.uk/blog/archives/575 http://innovelectronique.fr/2013/03/02/utilisation-du-bus-i2c-sur-raspberrypi/

installer le programme i2c-tools :

sudo apt-get install i2c-tool

telecharger cette librairy via npm et la lier à votre projet nodejs

npm install qtouch

et dans votre projet :

var qtouch = require("qtouch");

Usage

example on/off on KEY0 :

var qtouch = require("qtouch");

var KEY0 = 0;
var on = true;

qtouch.onPressUp(KEY0 , function(){
     if(on){
		console.log(" Light On ")
		on = false;
 	}else{
 		console.log(" Light Off ");
 		on = true;
 	}
});

you can have more example on example.js file

var qtouch = require("qtouch");

var KEY0=0 , KEY1=1;

//lecture en continu des valeurs sur bus I2C
qtouch.read(function(dataI2C){
   console.log(dataI2C);

  // sur le maintien du bouton 1 (KEY1)
  if(qtouch.binaryMask(dataI2C,1)){  // binary mask 
    console.log("Button 1 on");
  }else{
    console.log("Button 1 off");
  }
});


qtouch.onChange(function(newVal, oldVal){
    console.log("The Old Value is : "+ oldVal);
    console.log("The new Value is : "+ newVal);

    if(qtouch.binaryMask(oldVal,KEY0)){
      console.log("le bontton 0 vient d'etre relacher");
    }

    if(qtouch.binaryMask(newVal,KEY1)){
      console.log("le button 1 vient d'etre pressé");
    }
});