Remarks

Veml
Status
Source code GitHub
NuGet package

The TEMT6000 is an I2C ambient light sensor.

Code Example

public class MeadowApp : App<F7Micro, MeadowApp>
{
    Veml7700 _veml;

    public MeadowApp()
    {
        var bus = Device.CreateI2cBus();
        using (_veml = new Veml7700(bus))
        {

            _veml.ChangeThreshold = 10;
            _veml.LuxChanged += OnLightChanged;

            while (true)
            {
                Thread.Sleep(5000);
            }
        }
    }

    private void OnLightChanged(float previousValue, float newValue)
    {
        Console.WriteLine($"Light: {_veml.Lux} lux");
    }
}

Sample projects 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 System.Object > Veml7700
Implements System.IDisposable
Inherited Members System.Object.ToString() System.Object.Equals(System.Object) System.Object.Equals(System.Object, System.Object) System.Object.ReferenceEquals(System.Object, System.Object) System.Object.GetHashCode() System.Object.GetType() System.Object.MemberwiseClone()
Namespace Meadow.Foundation.Sensors.Light
Assembly Veml7700.dll

Syntax

public class Veml7700 : IDisposable

Constructors

Veml7700(II2cBus)

Declaration
public Veml7700(II2cBus bus)

Parameters

Type Name Description
II2cBus bus

Properties

Address

Declaration
public byte Address { get; }

Property Value

Type Description
System.Byte

ChangeThreshold

Declaration
public int ChangeThreshold { get; set; }

Property Value

Type Description
System.Int32

DataSource

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

Property Value

Type Description
Veml7700.LightSensor

Lux

Reads the value of white light channel

Declaration
public float Lux { get; }

Property Value

Type Description
System.Single

Methods

Dispose()

Dispose managed resources

Declaration
public void Dispose()

Dispose(Boolean)

Declaration
protected virtual void Dispose(bool disposing)

Parameters

Type Name Description
System.Boolean disposing

Events

LuxChanged

Declaration
public event Veml7700.ValueChangedHandler LuxChanged

Event Type

Type Description
Veml7700.ValueChangedHandler