1// Drive the Grive RGB LCD (a JHD1313m1)
2//
3// The way to drive the LCD directly from
4// Javascript code using the i2c interface directly
5// This approach is useful for learning about using
6// the i2c bus. The i2c file is an implementation
7// in Javascript for some of the common LCD functions
8
9// configure jshint
10/*jslint node:true, vars:true, bitwise:true, unparam:true */
11/*jshint unused:true */
12
13var upmMICSV89 = require("jsupm_micsv89");
14
15var mics = new upmMICSV89.MICSV89(6);
16
17while(1)
18{
19    mics.start();
20    while(!mics.valid());
21    console.log("co2: " + mics.co2equ());
22    console.log("short: " + mics.vocshort());
23    console.log("tvoc: " + mics.tvoc());
24    console.log("resistor: " + mics.resistor());
25    console.log("***********************");
26}
27