mirror of
https://github.com/eclipse/upm.git
synced 2025-07-01 09:21:12 +03:00
VEML6070: Initial Commit
This commit provides a basic driver for the Vishay VEML6070 UV Sensor. Some functionality might be missing. Binding examples have not been tested as of now. Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
This commit is contained in:
@ -188,6 +188,7 @@ add_example(BMA250E_Example bma250e)
|
||||
add_example(BMM150_Example bmm150)
|
||||
add_example(LSM303AGR_Example lsm303agr)
|
||||
add_example(LSM303D_Example lsm303d)
|
||||
add_example(VEML6070Sample veml6070)
|
||||
|
||||
add_example_with_path(Jhd1313m1_lcdSample jhd1313m1 jhd1313m1)
|
||||
add_example_with_path(Jhd1313m1Sample jhd1313m1 jhd1313m1)
|
||||
|
48
examples/java/VEML6070Sample.java
Normal file
48
examples/java/VEML6070Sample.java
Normal file
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Author: Abhishek Malik <abhishek.malik@intel.com>
|
||||
* Copyright (c) 2017 Intel Corporation.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import upm_veml6070.VEML6070;
|
||||
|
||||
public class VEML6070Sample {
|
||||
|
||||
public static void main(String[] args) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
//! [Interesting]
|
||||
// Instantiate a VEML6070 UV sensor
|
||||
VEML6070 veml = new VEML6070(0, 0x38);
|
||||
|
||||
while(true){
|
||||
System.out.println("UV Value: "+veml.getUVIntensity());
|
||||
try {
|
||||
Thread.sleep(500);
|
||||
} catch (InterruptedException e) {
|
||||
// TODO Auto-generated catch block
|
||||
System.out.println("The following exception occurred: "+e.getMessage());
|
||||
}
|
||||
}
|
||||
//! [Interesting]
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user