Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tessel-toggle-power

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tessel-toggle-power

Toggle a Tessel Relay module or Pin power On / Off

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Toggle a Tessel Relay module or Pin power On / Off

@ https://github.com/gdibble/tessel-toggle-power @ https://www.npmjs.com/package/tessel-toggle-power

First set a var for your pin or relay then try this example:
var togglePowerConfig = { use:'pin', pin:pin, pinNum:7 };
var togglePower = require('tessel-toggle-power').bind(togglePowerConfig);
togglePower();   // Toggle power on a pin or relay
togglePower(1);  // or togglePower(true)   // Manually set power On
togglePower(0);  // or togglePower(false)  // Manually set power Off
togglePowerConfig Options which get bound to fn as shown above^
{
  use:      'relay', // pass: 'relay' or 'pin', defaults to 'relay'
  pin:      pin,     // pass defined pin or relay, which ever you want used
  relay:    relay,   // ^
  relayChn: 1,       // pass: 1 or 2
  debug:    false    // pass: true or false
}
Example shell output from setting ^option debug:true
  • From running togglePower(1) or togglePower(true):

    
    togglePower:
    * Setting pin to 1
    * Pin set to 1    2016-05-23T04:17:26.259Z
    
    
  • From running togglePower(0) or togglePower(false):

    
    togglePower:
    * Setting pin to 0
    * Pin set to 0    2016-05-23T04:17:26.674Z
    
    
  • From running togglePower():

    
    togglePower:
    * Toggling relay
    * Relay toggled
    
    

Keywords

FAQs

Package last updated on 23 May 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc