raspi-io-server-utils
TypeScript icon, indicating that this package has built-in type declarations

1.3.1 • Public • Published

This package contains useful classes for the Raspberry Pi. TypeScript support included.

Changes: See CHANGELOG.md.

Usage

ES6 example:

// JavaScript
const { DigitalInput, DigitalOutput } = require( 'raspi-io-server-utils' );
 
// TypeScript
import { DigitalOutput } from 'raspi-io-server-utils/dist/src/io/digital-output';
import { DigitalInput } from 'raspi-io-server-utils/dist/src/io/digital-input';
 
const input = new DigitalInput( 11 );
const output = new DigitalOutput( 13 );
 
input.on( 'enable', () => {
    output.enabled = !output.enabled;
} );

AVPlayer

Starts audio/video files with VLC, mplayer, or omxplayer, whatever is available.

import { AvPlayer } from 'raspi-io-server-utils/dist/src/avplayer/av-player';
 
const player = new AvPlayer( [ 'vlc', 'omxplayer' ] );
player.play( 'movie.mp3' ).catch(
    ( err ) => console.error( 'Playback error', err )
);

IO

An extension to rpio with events on digital input/output pins and status report as JSON.

Note: Newer rpio and kernel combinations may cause freezes when hooking up interrupts. See 4.14 freezes when GPIO is pulled high and add dtoverlay=gpio-no-irq to /boot/config.txt for a workaround.

Vector clock

Small class implementing a Vector Clock for ordering asynchronous events.

Package Sidebar

Install

npm i raspi-io-server-utils

Weekly Downloads

3

Version

1.3.1

License

MIT

Unpacked Size

67.9 kB

Total Files

23

Last publish

Collaborators

  • granjow