forked from Moddable-OpenSource/moddable
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.js
More file actions
27 lines (24 loc) · 703 Bytes
/
main.js
File metadata and controls
27 lines (24 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
* Copyright (c) 2016-2017 Moddable Tech, Inc.
*
* This file is part of the Moddable SDK.
*
* This work is licensed under the
* Creative Commons Attribution 4.0 International License.
* To view a copy of this license, visit
* <http://creativecommons.org/licenses/by/4.0>.
* or send a letter to Creative Commons, PO Box 1866,
* Mountain View, CA 94042, USA.
*
*/
import GA1AUV100WP from "ga1auv100wp";
import Timer from "timer";
let sensor = new GA1AUV100WP();
sensor.configure({operation: "als"});
Timer.repeat(() => {
let value = sensor.sample();
if ("lux" in value)
trace(`LUX ${value.lux}\n`);
if ("uv" in value)
trace(`UV ${value.uv}\n`);
}, 100);