New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

tessel-reactive

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tessel-reactive

Reactive programming library For Tessel.IO

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

Introduction

Tessel reactive is a functional reactive programming library that uses BaconJS in order to expose streams for Tessel modules, buttons, pins, …

It allows you to quickly develop for a Tessel.io board in a functional/baconJS style.

Modules

The library contains classes to work in a reactive style using the following modules and perhiperals. Note that it DOES NOT depend on the required libraries for the supported tessel modules. You have to instantiate those yourself.

Modules provide either input, output or both. The inputs and outputs are BaconJS streams/buses respectively, and provide/consume objects. Each object has a value. For example, a digital pin will produce events with a value true/false depending on the pin state (high/low).

A LED (which is a digital pin set to output) can consume the same values in order to SET the pin state (see example).

Supported out of the box:

  • Digital pin (input/output)
    • Button (input)
    • LED (input/output)
    • Motion/PIR (input)
  • Climate (input/output)
    • Inputs
      • Temperature
      • Humidity
      • Heater state
    • Outputs
      • Heater state
      • Temperature calibration
      • Humidity calibration
  • Ambient (input)
    • Light level
    • Sound level
  • Relay (input/output)
    • Relay 1 state (input/output)
    • Relay 2 state (input/output)

Example

var tessel = require("tessel"), tr = require("tessel-reactive");
var climate = require("climate-si7020");
var ambient = require("ambient-attx4");

var climateModule = new tr.ClimateModule(climate.use(tessel.port.B),{name:"climateB", interval: 1000});

var ambientModule = new tr.AmbientModule(ambient.use(tessel.port.C),{name:"ambientA",interval: 1000});

var button = new tr.Button(new tr.DigitalPin(tessel.button),{name:"Button 2"});
var blueLED = new tr.DigitalPin(tessel.led[1]);

var aggregatedInputs = climateModule.input().merge(ambientModule.input());

aggregatedInputs.onValue(function(value)){
	console.log(value);
};

// subscribe the blue led pin to the output of the button.
// The led will respond to the boolean button states...
blueLED.output().plug(button.input());

Keywords

reactive

FAQs

Package last updated on 22 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts