upm/examples/java/GUVAS12D_Example.java
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

37 lines
1.1 KiB
Java

/*
* Author: Stefan Andritoiu <stefan.andritoiu@intel.com>
* Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2015-2016 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
*/
public class GUVAS12D_Example {
// analog voltage, usually 3.3 or 5.0
private static final float GUVAS12D_AREF = 5;
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
// Instantiate a GUVAS12D on analog pin A0
upm_guvas12d.GUVAS12D volts = new upm_guvas12d.GUVAS12D(0,
GUVAS12D_AREF);
while (true)
{
System.out.println("Volts: "
+ volts.volts()
+ ", Intensity: "
+ volts.intensity()
+ " mW/m^2");
Thread.sleep(1000);
}
// ! [Interesting]
}
}