Remarks

ArducamMini
Status Status badge: in-progress
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Camera.ArducamMini
public MeadowApp()
{
    Console.WriteLine("Creating output ports...");

    var camera = new ArducamMini(Device, Device.CreateSpiBus(), Device.Pins.D00, Device.CreateI2cBus());

    Thread.Sleep(1000);

    Console.WriteLine("Attempting single capture");
    camera.FlushFifo();
    camera.ClearFifoFlag();
    camera.StartCapture();

    Console.WriteLine("Capture started");

    Thread.Sleep(1000);

    if(camera.IsCaptureComplete())
    {
        Console.WriteLine("Capture complete");

        var data = camera.GetImageData();

        Console.WriteLine($"Jpeg captured {data.Length}");
    }
}

Sample project(s) available on GitHub

|

Code Example

ArducamMini camera;

public override async Task Initialize()
{
    Console.WriteLine("Initialize...");

    var spiBus = Device.CreateSpiBus(new Meadow.Units.Frequency(8, Meadow.Units.Frequency.UnitType.Megahertz));
    camera = new ArducamMini(Device, spiBus, Device.Pins.D00, Device.CreateI2cBus());

    await Task.Delay(1000);
}

public override Task Run()
{
    Console.WriteLine("Attempting single capture");
    camera.FlushFifo();
    camera.FlushFifo();
    camera.CapturePhoto();

    Console.WriteLine("Capture started");

    Thread.Sleep(1000);

    if (camera.IsPhotoAvaliable())
    {
        Console.WriteLine("Capture complete");

        var data = camera.GetImageData();

        Console.WriteLine($"Jpeg captured {data.Length}");
    }

    return Task.CompletedTask;
}

Sample project(s) available on GitHub

Characteristic Locus
Inheritance System.Object > ArducamMini
Namespace Meadow.Foundation.Sensors.Camera
Assembly ArducamMini.dll

Syntax

public class ArducamMini : object

Constructors

ArducamMini(IMeadowDevice, ISpiBus, IPin, II2cBus, Byte)

Declaration
public ArducamMini(IMeadowDevice device, ISpiBus spiBus, IPin chipSelectPin, II2cBus i2cBus, byte address = null)

Parameters

Type Name Description
IMeadowDevice device
ISpiBus spiBus
IPin chipSelectPin
II2cBus i2cBus
System.Byte address

Fields

DEFAULT_SPEED

Declaration
public int DEFAULT_SPEED

Field Value

Type Description
System.Int32

Methods

CapturePhoto()

Capture photo

Declaration
public bool CapturePhoto()

Returns

Type Description
System.Boolean

FlushFifo()

Flush FIFO

Declaration
public void FlushFifo()

GetImageData()

Declaration
public byte[] GetImageData()

Returns

Type Description
System.Byte[]

IsPhotoAvaliable()

Declaration
public bool IsPhotoAvaliable()

Returns

Type Description
System.Boolean

ReadFifo()

Declaration
public byte ReadFifo()

Returns

Type Description
System.Byte

ReadFifoLength()

Declaration
public int ReadFifoLength()

Returns

Type Description
System.Int32

WriteI2cRegisters(SensorReg[])

Declaration
protected void WriteI2cRegisters(SensorReg[] regs)

Parameters

Type Name Description
SensorReg[] regs

WriteSpiRegister(Byte, Byte)

Declaration
protected void WriteSpiRegister(byte address, byte value)

Parameters

Type Name Description
System.Byte address
System.Byte value