New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

matelight

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

matelight

client for matelight

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

node-matelight

matelight client for node.js using CRAP, the "Custom advanced video stReAming Protocol".

Install with:

npm install matelight

Examples are in the matelight playground

If you don't have a matelight, you can also use the emulator.

Usage

var matelight = require('matelight');

var client = matelight.connect();

client.startLoop(function(){
  client.setLight(2, 2, 200, 0, 200);
});

API

matelight.connect(host, port)

Create a new matelight connection. The host and portdefault to matelight.cbrp3.c-base.org:1337. This will be fine if you are at the c-base and your computer is connected to the crew network.

client.clean()

Cleans the matelight screen by setting all lights to off.

client.setLight(x, y, r, g, b)

Sets the light at positon x, y to color RGB(r, g, b)

CAUTION: the x and y values start at 1 as this seemed more intuitiv when pointing at the matelight.

Here is a sample that turns the most upper left light to red and the most lower right light to blue:

  client.setLight(1, 1, 255, 0, 0);
  client.setLight(40, 16, 0, 0, 255);

client.startLoop(cb, [interval])

Starts a loop which will clean the sceen, run the callback and then send all the lights which are set in the callback to the matelight screeen. If no intervall is given, it will default to 300 ms which seems to be a compromise between high framerates and dropped packages.

This example will send a red to the most upper left light every 100 ms:

var client = matelight.connect();

client.startLoop(function(){
  client.setLight(1, 1, 255, 0, 0);
}, 100);

client.stopLoop();

Stops the loop. Nothing will be send to the matelight anymore.

CAUTION: Even if the loop is stopped, some UDP packages might still arrive at the matelight.

Extras

Some things that are exposed through the module. Only mess with this if you know what you are doing.

client.ROWS

The ammount of rows of the matelight

client.COLS

The ammount of columns of the matelight

client.udpClient

The underlying udp client which is used to send the image buffers

FAQs

Package last updated on 27 Feb 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

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