BH1745 Digital Color Sensor

BH1745 is an I2C digital color sensor, which is handled with the BH1745 module.

How to use

I2C1.setup({scl:B6,sda:B7});
var color = require("BH1745").connectI2C(I2C1);
setInterval(function() {
  print(color.read());
  // outputs {r,g,b,c}
}, 160);

By default this sensor outputs data every 160ms, with red (r), green (g), blue (b), and clear (c) values.

Reference

// Shut down the sensor
BH1745.prototype.stop = function () { ... }

// read the current light measurements as {r,g,b,c}
BH1745.prototype.read = function () { ... }

// Initialise the BH1745 module with the given I2C interface (and optional address with connectI2C(i2c,{addr:...}) )
exports.connectI2C = function (i2c, options) { ... }

This page is auto-generated from GitHub. If you see any mistakes or have suggestions, please let us know.