Meadow.Foundation.Sensors.Camera.ArducamMini
ArducamMini | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
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;
}