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

j5-ds-touch

v0.3.1

Published

Nintendo DS Touch Screen component class plugin for Johnny-Five

Downloads

15

Readme

DSTouch

Build Status

A DS Touch Screen component plugin for Johnny-Five.

API & Documentation

DSTouch

The DSTouch class constructs objects that represent a single Nintendo DS Touch screen component.

var touch = new DSTouch();

touch.on("change", function() {
  console.log(this.x, this.y);
});

Parameters

| Property | Type | Value(s)/Description | Default | Required | |------------|-----------|---------------------------|---------|----------| | address | number | Address for I2C device * | 0x04 | no |

// Example of explicitly specified address
var touch = new DSTouch({
  address: 0x04
});

* The address used by this "backpack" component is 0x04. This can be changed by modifying the value in the firmware.

Properties

| Property | Type | Value(s)/Description | |------------|-----------|---------------------------| | x | number | The x coordinate of the present touch point. Will read 1023 if there is no touch point. | | y | number | The y coordinate of the present touch point. Will read 1023 if there is no touch point. |

Events

  • change Fired whenever the [x, y] coordinates of the pointer has changed.

  • data Fired as frequently as the hardware can be read.

  • down / pointerdown The pointer makes physical contact with the surface, but was previously not touching the surface (similar to the browser mousedown or pointerdown event).

  • move / pointermove The pointer is touching the surface and has changed coordinates since the last position was read (similar to the browser mousemove or pointermove event).

  • up / pointerup The pointer no longer has physical contact with surface, but was previously touching the surface (similar to the browser mouseup or pointerup event).

NOTE: The word pointer means either capacitive or resistive stylus, or finger.

Backpack Controller

Install Firmware

Using the Arduino IDE, install the firmware to your AVR based microcontroller of choice.

Assembly

DS Touch μC Backpack

Connect To I2C Capable Platform

Arduino UNO

DS Touch Backpack + Arduino UNO

var five = require("johnny-five");
var DSTouch = require("j5-ds-touch")(five);
var board = new five.Board();

board.on("ready", function() {
  var touch = new DSTouch();

  touch.on("pointermove", function() {
    console.log({ x: this.x, y: this.y });
  });
});

Tessel 2

DS Touch Backpack + Tessel 2

var five = require("johnny-five");
var DSTouch = require("j5-ds-touch")(five);
var Tessel = require("tessel-io");
var board = new five.Board({
  io: new Tessel()
});

board.on("ready", function() {
  var touch = new DSTouch();

  touch.on("pointermove", function() {
    console.log({ x: this.x, y: this.y });
  });
});

Intel Edison MiniBoard

DS Touch Backpack + Intel Edison MiniBoard

Intel Edison Arduino Board

DS Touch Backpack + Arduino Board

var five = require("johnny-five");
var DSTouch = require("j5-ds-touch")(five);
var Edison = require("edison-io");
var board = new five.Board({
  io: new Edison()
});

board.on("ready", function() {
  var touch = new DSTouch();

  touch.on("pointermove", function() {
    console.log({ x: this.x, y: this.y });
  });
});

Ploma App

This repo comes with a version of @evhan55's example Ploma app that has been modified to accept input from a socket instead of a Wacom tablet.

Hello Ploma

To Run:

node eg/server.js

NOTE

The examples shown here are provided for illustration and do no specifically indicate platform support. This component class is expected to work with any platform that has I2C support.