Remarks

Veml7700
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Light.Veml7700

The TEMT6000 is an I2C ambient light sensor.

Code Example

Veml7700 sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initialize...");

    sensor = new Veml7700(Device.CreateI2cBus());
    sensor.DataSource = Veml7700.SensorTypes.Ambient;

    sensor.RangeExceededHigh += (s, a) => Resolver.Log.Info("Too bright to measure");
    sensor.RangeExceededLow += (s, a) => Resolver.Log.Info("Too dim to measure");

    // classical .NET events can also be used:
    sensor.Updated += (sender, result) => Resolver.Log.Info($"Illuminance: {result.New.Lux:n3}Lux");

    return Task.CompletedTask;
}

public override async Task Run()
{
    var conditions = await sensor.Read();

    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Illuminance: {conditions.Lux:n3}Lux");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Veml7700 to your Meadow board, connect the following:

Veml7700 Meadow Pin
3V3 3V3
GND GND
SCK D08
SDA D07

It should look like the following diagram:

Characteristic Locus
Inheritance object ObservableBase<Illuminance> SamplingSensorBase<Illuminance> PollingSensorBase<Illuminance> ByteCommsSensorBase<Illuminance> > Veml7700
Implements IObservable<IChangeResult<Illuminance>> ILightSensor ISamplingSensor<Illuminance> ISensor<Illuminance> II2cPeripheral IDisposable
Inherited Members ByteCommsSensorBase<Illuminance>.Init(int, int) ByteCommsSensorBase<Illuminance>.Dispose(bool) ByteCommsSensorBase<Illuminance>.Dispose() ByteCommsSensorBase<Illuminance>.BusComms ByteCommsSensorBase<Illuminance>.ReadBuffer ByteCommsSensorBase<Illuminance>.WriteBuffer PollingSensorBase<Illuminance>.StartUpdating(TimeSpan?) PollingSensorBase<Illuminance>.StopUpdating() SamplingSensorBase<Illuminance>.samplingLock SamplingSensorBase<Illuminance>.Read() SamplingSensorBase<Illuminance>.SamplingTokenSource SamplingSensorBase<Illuminance>.Conditions SamplingSensorBase<Illuminance>.IsSampling SamplingSensorBase<Illuminance>.UpdateInterval SamplingSensorBase<Illuminance>.Updated ObservableBase<Illuminance>.NotifyObservers(IChangeResult<Illuminance>) ObservableBase<Illuminance>.Subscribe(IObserver<IChangeResult<Illuminance>>) ObservableBase<Illuminance>.CreateObserver(Action<IChangeResult<Illuminance>>, Predicate<IChangeResult<Illuminance>>) ObservableBase<Illuminance>.observers object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString()
Namespace Meadow.Foundation.Sensors.Light
Assembly Veml7700.dll

Syntax

public class Veml7700 : ByteCommsSensorBase<Illuminance>, IObservable<IChangeResult<Illuminance>>, ILightSensor, ISamplingSensor<Illuminance>, ISensor<Illuminance>, II2cPeripheral, IDisposable

Constructors

Veml7700(II2cBus)

Create a new Veml7700 object with the default address

Declaration
public Veml7700(II2cBus i2cBus)

Parameters

Type Name Description
II2cBus i2cBus

The I2C bus

Remarks

Veml7700
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Light.Veml7700

The TEMT6000 is an I2C ambient light sensor.

Code Example

Veml7700 sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initialize...");

    sensor = new Veml7700(Device.CreateI2cBus());
    sensor.DataSource = Veml7700.SensorTypes.Ambient;

    sensor.RangeExceededHigh += (s, a) => Resolver.Log.Info("Too bright to measure");
    sensor.RangeExceededLow += (s, a) => Resolver.Log.Info("Too dim to measure");

    // classical .NET events can also be used:
    sensor.Updated += (sender, result) => Resolver.Log.Info($"Illuminance: {result.New.Lux:n3}Lux");

    return Task.CompletedTask;
}

public override async Task Run()
{
    var conditions = await sensor.Read();

    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Illuminance: {conditions.Lux:n3}Lux");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Veml7700 to your Meadow board, connect the following:

Veml7700 Meadow Pin
3V3 3V3
GND GND
SCK D08
SDA D07

It should look like the following diagram:

Properties

DataSource

Sensor types Data source

Declaration
public Veml7700.SensorTypes DataSource { get; set; }

Property Value

Type Description
Veml7700.SensorTypes

Remarks

Veml7700
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Light.Veml7700

The TEMT6000 is an I2C ambient light sensor.

Code Example

Veml7700 sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initialize...");

    sensor = new Veml7700(Device.CreateI2cBus());
    sensor.DataSource = Veml7700.SensorTypes.Ambient;

    sensor.RangeExceededHigh += (s, a) => Resolver.Log.Info("Too bright to measure");
    sensor.RangeExceededLow += (s, a) => Resolver.Log.Info("Too dim to measure");

    // classical .NET events can also be used:
    sensor.Updated += (sender, result) => Resolver.Log.Info($"Illuminance: {result.New.Lux:n3}Lux");

    return Task.CompletedTask;
}

public override async Task Run()
{
    var conditions = await sensor.Read();

    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Illuminance: {conditions.Lux:n3}Lux");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Veml7700 to your Meadow board, connect the following:

Veml7700 Meadow Pin
3V3 3V3
GND GND
SCK D08
SDA D07

It should look like the following diagram:

DefaultI2cAddress

The default I2C address for the peripheral

Declaration
public byte DefaultI2cAddress { get; }

Property Value

Type Description
byte

Remarks

Veml7700
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Light.Veml7700

The TEMT6000 is an I2C ambient light sensor.

Code Example

Veml7700 sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initialize...");

    sensor = new Veml7700(Device.CreateI2cBus());
    sensor.DataSource = Veml7700.SensorTypes.Ambient;

    sensor.RangeExceededHigh += (s, a) => Resolver.Log.Info("Too bright to measure");
    sensor.RangeExceededLow += (s, a) => Resolver.Log.Info("Too dim to measure");

    // classical .NET events can also be used:
    sensor.Updated += (sender, result) => Resolver.Log.Info($"Illuminance: {result.New.Lux:n3}Lux");

    return Task.CompletedTask;
}

public override async Task Run()
{
    var conditions = await sensor.Read();

    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Illuminance: {conditions.Lux:n3}Lux");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Veml7700 to your Meadow board, connect the following:

Veml7700 Meadow Pin
3V3 3V3
GND GND
SCK D08
SDA D07

It should look like the following diagram:

Illuminance

Luminosity reading from the TSL2561 sensor.

Declaration
public Illuminance? Illuminance { get; protected set; }

Property Value

Type Description
Illuminance?

Remarks

Veml7700
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Light.Veml7700

The TEMT6000 is an I2C ambient light sensor.

Code Example

Veml7700 sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initialize...");

    sensor = new Veml7700(Device.CreateI2cBus());
    sensor.DataSource = Veml7700.SensorTypes.Ambient;

    sensor.RangeExceededHigh += (s, a) => Resolver.Log.Info("Too bright to measure");
    sensor.RangeExceededLow += (s, a) => Resolver.Log.Info("Too dim to measure");

    // classical .NET events can also be used:
    sensor.Updated += (sender, result) => Resolver.Log.Info($"Illuminance: {result.New.Lux:n3}Lux");

    return Task.CompletedTask;
}

public override async Task Run()
{
    var conditions = await sensor.Read();

    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Illuminance: {conditions.Lux:n3}Lux");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Veml7700 to your Meadow board, connect the following:

Veml7700 Meadow Pin
3V3 3V3
GND GND
SCK D08
SDA D07

It should look like the following diagram:

Methods

RaiseEventsAndNotify(IChangeResult<Illuminance>)

Raise events for subscribers and notify of value changes

Declaration
protected override void RaiseEventsAndNotify(IChangeResult<Illuminance> changeResult)

Parameters

Type Name Description
IChangeResult<Illuminance> changeResult

The updated sensor data

Overrides

Remarks

Veml7700
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Light.Veml7700

The TEMT6000 is an I2C ambient light sensor.

Code Example

Veml7700 sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initialize...");

    sensor = new Veml7700(Device.CreateI2cBus());
    sensor.DataSource = Veml7700.SensorTypes.Ambient;

    sensor.RangeExceededHigh += (s, a) => Resolver.Log.Info("Too bright to measure");
    sensor.RangeExceededLow += (s, a) => Resolver.Log.Info("Too dim to measure");

    // classical .NET events can also be used:
    sensor.Updated += (sender, result) => Resolver.Log.Info($"Illuminance: {result.New.Lux:n3}Lux");

    return Task.CompletedTask;
}

public override async Task Run()
{
    var conditions = await sensor.Read();

    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Illuminance: {conditions.Lux:n3}Lux");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Veml7700 to your Meadow board, connect the following:

Veml7700 Meadow Pin
3V3 3V3
GND GND
SCK D08
SDA D07

It should look like the following diagram:

ReadSensor()

Reads data from the sensor

Declaration
protected override Task<Illuminance> ReadSensor()

Returns

Type Description
Task<Illuminance>

The latest sensor reading

Overrides

Remarks

Veml7700
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Light.Veml7700

The TEMT6000 is an I2C ambient light sensor.

Code Example

Veml7700 sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initialize...");

    sensor = new Veml7700(Device.CreateI2cBus());
    sensor.DataSource = Veml7700.SensorTypes.Ambient;

    sensor.RangeExceededHigh += (s, a) => Resolver.Log.Info("Too bright to measure");
    sensor.RangeExceededLow += (s, a) => Resolver.Log.Info("Too dim to measure");

    // classical .NET events can also be used:
    sensor.Updated += (sender, result) => Resolver.Log.Info($"Illuminance: {result.New.Lux:n3}Lux");

    return Task.CompletedTask;
}

public override async Task Run()
{
    var conditions = await sensor.Read();

    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Illuminance: {conditions.Lux:n3}Lux");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Veml7700 to your Meadow board, connect the following:

Veml7700 Meadow Pin
3V3 3V3
GND GND
SCK D08
SDA D07

It should look like the following diagram:

SetPower(bool)

Set power mode

Declaration
public void SetPower(bool on)

Parameters

Type Name Description
bool on

Remarks

Veml7700
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Light.Veml7700

The TEMT6000 is an I2C ambient light sensor.

Code Example

Veml7700 sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initialize...");

    sensor = new Veml7700(Device.CreateI2cBus());
    sensor.DataSource = Veml7700.SensorTypes.Ambient;

    sensor.RangeExceededHigh += (s, a) => Resolver.Log.Info("Too bright to measure");
    sensor.RangeExceededLow += (s, a) => Resolver.Log.Info("Too dim to measure");

    // classical .NET events can also be used:
    sensor.Updated += (sender, result) => Resolver.Log.Info($"Illuminance: {result.New.Lux:n3}Lux");

    return Task.CompletedTask;
}

public override async Task Run()
{
    var conditions = await sensor.Read();

    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Illuminance: {conditions.Lux:n3}Lux");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Veml7700 to your Meadow board, connect the following:

Veml7700 Meadow Pin
3V3 3V3
GND GND
SCK D08
SDA D07

It should look like the following diagram:

Events

IlluminanceUpdated

Raised when the luminosity value changes

Declaration
public event EventHandler<IChangeResult<Illuminance>> IlluminanceUpdated

Event Type

Type Description
EventHandler<IChangeResult<Illuminance>>

Remarks

Veml7700
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Light.Veml7700

The TEMT6000 is an I2C ambient light sensor.

Code Example

Veml7700 sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initialize...");

    sensor = new Veml7700(Device.CreateI2cBus());
    sensor.DataSource = Veml7700.SensorTypes.Ambient;

    sensor.RangeExceededHigh += (s, a) => Resolver.Log.Info("Too bright to measure");
    sensor.RangeExceededLow += (s, a) => Resolver.Log.Info("Too dim to measure");

    // classical .NET events can also be used:
    sensor.Updated += (sender, result) => Resolver.Log.Info($"Illuminance: {result.New.Lux:n3}Lux");

    return Task.CompletedTask;
}

public override async Task Run()
{
    var conditions = await sensor.Read();

    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Illuminance: {conditions.Lux:n3}Lux");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Veml7700 to your Meadow board, connect the following:

Veml7700 Meadow Pin
3V3 3V3
GND GND
SCK D08
SDA D07

It should look like the following diagram:

RangeExceededHigh

Raised when the high range is exceeded

Declaration
public event EventHandler RangeExceededHigh

Event Type

Type Description
EventHandler

Remarks

Veml7700
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Light.Veml7700

The TEMT6000 is an I2C ambient light sensor.

Code Example

Veml7700 sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initialize...");

    sensor = new Veml7700(Device.CreateI2cBus());
    sensor.DataSource = Veml7700.SensorTypes.Ambient;

    sensor.RangeExceededHigh += (s, a) => Resolver.Log.Info("Too bright to measure");
    sensor.RangeExceededLow += (s, a) => Resolver.Log.Info("Too dim to measure");

    // classical .NET events can also be used:
    sensor.Updated += (sender, result) => Resolver.Log.Info($"Illuminance: {result.New.Lux:n3}Lux");

    return Task.CompletedTask;
}

public override async Task Run()
{
    var conditions = await sensor.Read();

    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Illuminance: {conditions.Lux:n3}Lux");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Veml7700 to your Meadow board, connect the following:

Veml7700 Meadow Pin
3V3 3V3
GND GND
SCK D08
SDA D07

It should look like the following diagram:

RangeExceededLow

Raised when the low range is exceeded

Declaration
public event EventHandler RangeExceededLow

Event Type

Type Description
EventHandler

Remarks

Veml7700
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Light.Veml7700

The TEMT6000 is an I2C ambient light sensor.

Code Example

Veml7700 sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initialize...");

    sensor = new Veml7700(Device.CreateI2cBus());
    sensor.DataSource = Veml7700.SensorTypes.Ambient;

    sensor.RangeExceededHigh += (s, a) => Resolver.Log.Info("Too bright to measure");
    sensor.RangeExceededLow += (s, a) => Resolver.Log.Info("Too dim to measure");

    // classical .NET events can also be used:
    sensor.Updated += (sender, result) => Resolver.Log.Info($"Illuminance: {result.New.Lux:n3}Lux");

    return Task.CompletedTask;
}

public override async Task Run()
{
    var conditions = await sensor.Read();

    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Illuminance: {conditions.Lux:n3}Lux");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Veml7700 to your Meadow board, connect the following:

Veml7700 Meadow Pin
3V3 3V3
GND GND
SCK D08
SDA D07

It should look like the following diagram: