mirror of
https://github.com/eclipse/upm.git
synced 2025-07-01 17:31:13 +03:00
bh17xx: minor documentation and formatting updates, added rohm to vendor groups
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
@ -25,27 +25,29 @@
|
||||
public class BH1749_Example {
|
||||
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
int sampleCounter = 10;
|
||||
long waitTime;
|
||||
upm_bh1749.BH1749 bh1749;
|
||||
upm_bh1749.uint16Vector result;
|
||||
|
||||
bh1749 = new upm_bh1749.BH1749();
|
||||
bh1749.SensorInit(upm_bh1749.OPERATING_MODES.INT_JUDGE_1,
|
||||
upm_bh1749.MEAS_TIMES.MEAS_240MS, upm_bh1749.RGB_GAINS.RGB_GAIN_1X,
|
||||
upm_bh1749.IR_GAINS.IR_GAIN_1X, upm_bh1749.INT_SOURCES.RED);
|
||||
bh1749.SetThresholdHigh(511);
|
||||
bh1749.Enable();
|
||||
//! [Interesting]
|
||||
int sampleCounter = 10;
|
||||
long waitTime;
|
||||
upm_bh1749.BH1749 bh1749;
|
||||
upm_bh1749.uint16Vector result;
|
||||
|
||||
bh1749 = new upm_bh1749.BH1749();
|
||||
bh1749.SensorInit(upm_bh1749.OPERATING_MODES.INT_JUDGE_1,
|
||||
upm_bh1749.MEAS_TIMES.MEAS_240MS, upm_bh1749.RGB_GAINS.RGB_GAIN_1X,
|
||||
upm_bh1749.IR_GAINS.IR_GAIN_1X, upm_bh1749.INT_SOURCES.RED);
|
||||
bh1749.SetThresholdHigh(511);
|
||||
bh1749.Enable();
|
||||
|
||||
waitTime = bh1749.GetMeasurementTime();
|
||||
System.out.println("Color readings");
|
||||
System.out.println("Color readings");
|
||||
while (sampleCounter-- > 0) {
|
||||
result = bh1749.GetMeasurements();
|
||||
System.out.println("R: " + result.get(0) + ", G: " + result.get(1) +
|
||||
", B: " + result.get(2) + ", IR: " + result.get(3) +
|
||||
", G2: " + result.get(4));
|
||||
System.out.println("R: " + result.get(0) + ", G: " + result.get(1) +
|
||||
", B: " + result.get(2) + ", IR: " + result.get(3) +
|
||||
", G2: " + result.get(4));
|
||||
|
||||
Thread.sleep((long) waitTime);
|
||||
}
|
||||
//! [Interesting]
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user