mirror of
https://github.com/eclipse/upm.git
synced 2025-03-16 21:47:29 +03:00

Removed some unneeded calls in update function. Changed call in micsv89.js sample file to use update instead of start. Tested with UPM. 4.0. The micsv89 is sensitive to other devices pulling the I2c bus up, so it is not likely to work on the Arduino breakout. I2c 1 on mini breakout works fine. —Signed-off-by Marc Graham <marc@m2ag.net> Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
27 lines
773 B
JavaScript
27 lines
773 B
JavaScript
// Drive the Grive RGB LCD (a JHD1313m1)
|
|
//
|
|
// The way to drive the LCD directly from
|
|
// Javascript code using the i2c interface directly
|
|
// This approach is useful for learning about using
|
|
// the i2c bus. The i2c file is an implementation
|
|
// in Javascript for some of the common LCD functions
|
|
|
|
// configure jshint
|
|
/*jslint node:true, vars:true, bitwise:true, unparam:true */
|
|
/*jshint unused:true */
|
|
|
|
var upmMICSV89 = require("jsupm_micsv89");
|
|
|
|
var mics = new upmMICSV89.MICSV89(6);
|
|
|
|
while(1)
|
|
{
|
|
mics.update();
|
|
while(!mics.valid());
|
|
console.log("co2: " + mics.co2equ());
|
|
console.log("short: " + mics.vocshort());
|
|
console.log("tvoc: " + mics.tvoc());
|
|
console.log("resistor: " + mics.resistor());
|
|
console.log("***********************");
|
|
}
|