mirror of
https://github.com/eclipse/upm.git
synced 2025-07-01 09:21:12 +03:00
VEML6070: Adding separate i2c contexts for separate addresses
Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
This commit is contained in:
@ -44,7 +44,7 @@ int main ()
|
||||
|
||||
//! [Interesting]
|
||||
// Instantiate an VEML6070 sensor on i2c bus 0
|
||||
upm::VEML6070* veml = new upm::VEML6070(0, VEML6070_CTRL_REG);
|
||||
upm::VEML6070* veml = new upm::VEML6070(0);
|
||||
while (shouldRun) {
|
||||
cout << "Retrieved UV value: " << veml->getUVIntensity() << endl;
|
||||
sleep(1);
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
veml6070_context dev = veml6070_init(0, VEML6070_CTRL_REG);
|
||||
veml6070_context dev = veml6070_init(0);
|
||||
if(dev == NULL) {
|
||||
printf("Unable to initialize sensor\n");
|
||||
return 0;
|
||||
|
@ -31,7 +31,7 @@ public class VEML6070Sample {
|
||||
|
||||
//! [Interesting]
|
||||
// Instantiate a VEML6070 UV sensor
|
||||
VEML6070 veml = new VEML6070(0, 0x38);
|
||||
VEML6070 veml = new VEML6070(0);
|
||||
|
||||
while(true){
|
||||
System.out.println("UV Value: "+veml.getUVIntensity());
|
||||
|
@ -25,7 +25,7 @@
|
||||
var veml6070 = require("jsupm_veml6070");
|
||||
|
||||
// Instantiate a Vishay UV sensor at bus 0
|
||||
var veml6070_sensor = new veml6070.VEML6070(0, 0x38);
|
||||
var veml6070_sensor = new veml6070.VEML6070(0);
|
||||
|
||||
var myInterval = setInterval(function()
|
||||
{
|
||||
|
@ -27,7 +27,7 @@ from upm import pyupm_veml6070 as veml6070
|
||||
|
||||
def main():
|
||||
# Instantiate a Vishay UV Sensor on the I2C bus 0
|
||||
veml6070_sensor = veml6070.VEML6070(0, 0x38);
|
||||
veml6070_sensor = veml6070.VEML6070(0);
|
||||
|
||||
## Exit handlers ##
|
||||
# This function stops python from printing a stacktrace when you hit control-C
|
||||
|
Reference in New Issue
Block a user