ev3-js-color-sensor

0.1.5 • Public • Published

color-sensor

NPM version Code style

use the ev3 color sensor

Installation

$ npm install ev3-js-color-sensor

Usage

var ColorSensor = require('ev3-js-color-sensor')
ColorSensor(1).reflected // => 88
ColorSensor(1).color // => 7

API

ColorSensor(port)

  • port - number of the port that the color sensor is plugged in to.

Returns: instance of ColorSensor

.reflected

Gets the value of the reflected light intensity.

Returns: number between 0 and 100

.color

Gets the value of the color.

Returns: color value between 0 and 7

number color
0 no color
1 black
2 blue
3 green
4 yellow
5 red
6 white
7 brown

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i ev3-js-color-sensor

Weekly Downloads

2

Version

0.1.5

License

MIT

Last publish

Collaborators

  • danleavitt0