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

node-red-contrib-node-stemhat

v1.0.1

Published

Basic Node-RED node for STEM HAT

Downloads

6

Readme

node-stemhat

A set of Node-RED nodes that is able to be used by the STEM HAT hardware to output digital and analog signals and read digital and analog signals.

Installation

npm i node-red-contrib-node-stemhat

Common Usage

This package of nodes includes 10 types of nodes, which are STEM HAT LED, STEM HAT Servo, STEM HAT Motor, STEM HAT Light Sensor, STEM HAT Vin Voltage, STEM HAT Analog in, STEM HAT Buzzer, STEM HAT GPIO OUT, STEM HAT GPIO IN and STEM HAT Ultrasonic.

Analog Output Nodes

The analog output nodes are nodes that gives out analog output to the hardware with value in a certain range.

STEM HAT LED

STEM HAT LED output node gives out analog output from range of 0 to 255. User can choose between RGB0 with colour red, green or blue and RGB1 with colour red, green or blue. When increasing the value of input, the LED with light up brighter. If the input to the node is not between the range of 0 to 255, there will not be any response from the LED.

STEM HAT Servo

STEM HAT Servo output node gives out analog output from range of 0 to 180, where the default value is 90. User can choose between servo 1, servo 2, servo 3, and servo 4. The input value is representing the angle of rotation of the servo motor. If the input to the node is not between the range of 0 to 180, there will not be any response from the servo motor.

STEM HAT Motor

STEM HAT Motor output node gives out analog output from range of -255 to 255. User can choose between motor 1 and motor 2. The input value is representing the speed of the motor and the positive value represent postitve rotation and negative value represent negative rotation. If the input to the node is not between the range of -255 to 255, there will not be any response from the motor.

Analog Input Nodes

The analog input nodes are nodes that reads analog data from the hardware and communicate using i2c bus to get the value.

STEM HAT Light Sensor

The sensor will read the light intensity of the environment and give out a value ranging from 0 to 255.

STEM HAT Vin Voltage

The pin will read the voltage input value and give out a value ranging from 0 to 255. The input voltage is equivalent to the output value divided by 10.

STEM HAT Analog In

User can choose between the pins AN0 and AN1. The pin will read the input data from the pin and give out a value ranging from 0 to 255.

Digital Output Nodes

The digital ouput nodes are nodes that gives out digital output with either 0 or 1 (or true or false).

STEM HAT Buzzer

When the output is 0 or false, the buzzer will not sound. When the output is 1 or true, the buzzer will produce a 'beep' sound.

STEM HAT GPIO OUT

User can choose between the pins GPIO 12 and GPIO 13. The output will be sent to the device that are connected to the corresponding output pins.

Digital Input Nodes

The digital input nodes are nodes that will read the state of the pins that are selected and generates a msg.payload with either 0 or 1 depending on the state of the pins.

STEM HAT GPIO IN

User can choose between the pins GPIO 5, GPIO 6, GPIO 12 and GPIO 13. When selected, the node will read the state of the selected pin.

STEM HAT Ultrasonic

STEM HAT Ultrasonic input node requires a 4 pin ultrasonic sensor. Generates a msg.payload representing the distance in centimeters according the time between the trigger and echo.