Giter VIP home page Giter VIP logo

mmm-pins's Introduction

MMM-Pins

This is an extension for the MagicMirror. It can toggle pins specified in the config.

You can specify any number of pins with different trigger messages. All messages will be registered with the MMM-Remote Module automatically to trigger the messages from the remote control web app but can be triggered from any other module, as well. It can also play sounds using MMM-Sounds module when a pin is toggled.

You should have MMM-Remote Module and MMM-Sounds installed and configured with your mirror to get the best out of this module ;) Special thanks therefore goes to Jopyth and jc21 for their amazing work!

Installation

  1. Navigate into your MagicMirror's modules folder and execute git clone https://github.com/ptrbld/MMM-Pins.git. A new folder will appear navigate into it.
  2. Execute npm install to install the node dependencies.

Using the module

First of all connect some leds, etc. to your pins on the pi Raspberry PI. I am using this module currently to turn some 5v leds on and off with TIP120 darlington transistors.

To use this module, add it to the modules array in the config/config.js file:

modules: [
	{
		module: 'MMM-Pins',
		config: {
			// See 'Configuration options' for more information.
		}
	}
]

Configuration options

Basic

The following properties can be configured:

Option Description
pinConfiguration Array of pin objects you want to toggle by notification.

Possible values: [{pin:5, direction:"out", notification:"MY_NOTIFICATION", sound:"ANY_SOUNDFILE" prettyName: "Test"}, ...]

Single Pin Configuration

Option Description
pin The pin number you want to toggle
direction If it is a input or output pin (values: "in" | "out")
notification Any notification name that should trigger the toggle event. The notifications are additional registered with the MMM-Remote-Control module if present.
sound Sound that should be played using the MMM-Sounds module when pin is triggered (filename)
prettyName Name used in the remote view of the MMM-Remote-Control module

Dependencies

  • onoff (installed via npm install)

The MIT License (MIT)

Copyright © 2016 PtrBld

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

The software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.

mmm-pins's People

Contributors

ptrbld avatar bludau-peter avatar

Stargazers

Kristjan ESPERANTO avatar LandStein avatar Olli avatar

Watchers

James Cloos avatar Kristjan ESPERANTO avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.