VEML6070: Adding separate i2c contexts for separate addresses

Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
This commit is contained in:
Abhishek Malik
2017-05-18 13:55:21 -07:00
parent c70f378f72
commit b4bc15201b
9 changed files with 56 additions and 148 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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());

View File

@ -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()
{

View File

@ -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