upm/examples/javascript/veml6070.js
Mihai Tudor Panu 89d5de43e0 license: update to SPDX style license text throughout
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2020-03-05 15:13:36 -08:00

29 lines
713 B
JavaScript

/*
* Author: Abhishek Malik <abhishek.malik@intel.com>
* Copyright (c) 2017 Intel Corporation.
*
* 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.
*
* SPDX-License-Identifier: MIT
*/
var veml6070 = require("jsupm_veml6070");
// Instantiate a Vishay UV sensor at bus 0
var veml6070_sensor = new veml6070.VEML6070(0);
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);
});