2017-05-04 00:33:20 -07:00
|
|
|
/*
|
|
|
|
|
* Author: Abhishek Malik <abhishek.malik@intel.com>
|
|
|
|
|
* Copyright (c) 2017 Intel Corporation.
|
|
|
|
|
*
|
2019-07-30 19:41:32 -07:00
|
|
|
* This program and the accompanying materials are made available under the
|
|
|
|
|
* terms of the The MIT License which is available at
|
|
|
|
|
* https://opensource.org/licenses/MIT.
|
2017-05-04 00:33:20 -07:00
|
|
|
*
|
2019-07-30 19:41:32 -07:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-05-04 00:33:20 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
var veml6070 = require("jsupm_veml6070");
|
|
|
|
|
|
|
|
|
|
// Instantiate a Vishay UV sensor at bus 0
|
2017-05-18 13:55:21 -07:00
|
|
|
var veml6070_sensor = new veml6070.VEML6070(0);
|
2017-05-04 00:33:20 -07:00
|
|
|
|
|
|
|
|
var myInterval = setInterval(function()
|
|
|
|
|
{
|
|
|
|
|
console.log("UV value: " + veml6070_sensor.getUVIntensity());
|
|
|
|
|
}, 100);
|
|
|
|
|
|
|
|
|
|
// When exiting: clear interval and print message
|
|
|
|
|
process.on('SIGINT', function()
|
|
|
|
|
{
|
|
|
|
|
clearInterval(myInterval);
|
|
|
|
|
console.log("Exiting...");
|
|
|
|
|
process.exit(0);
|
|
|
|
|
});
|