Main Site Documentation

Serial camera output


#1

Hello
i have a simple code :


sdCard.MountSDCard();
serCam.StartStreaming();
 byte[] data = serCam.dataImage;
 string name = "img.bmp";
 sdCard.GetStorageDevice().WriteFile(name, data);
 serCam.StopStreaming();
 sdCard.UnmountSDCard();

the img.bmp file will be saved on sd card in 13Kb, but usually I receive error about damaged file "windows ca not open the file , it is damaged or …"
can eanybody help me?
thanks


#2

Please see the note about flush all here
https://www.ghielectronics.com/docs/51/accessing-folders-and-files


#3

maybe you have to test the [quote]isNewImageReady[/quote] property


#4

thanks for answers
It seems that the problem is not about writing byte array on sd card.
the property of :


always return FALSE !!!!
apart from that, I've read this note : 
https://www.ghielectronics.com/docs/176/serial-camera-module
but i don't have this methods :

```cs]https://www.ghielectronics.com/docs/176/serial-camera-module[/code

Is it in a new version of .net micro framework?

#5

sorry for mistake, It is the mentioned code :


#6

the name of the file is wrong? It should begin with \SD… ?


#7

Thanks very much for your attentions…
I’m using net micro framework sdk 4.2
Is that method just for sdk ver 4.3?
Mike : I’'m writing the file on sd and I can see it when I connect sd to my pc. Ut when i want to open it, I recieve that error


#8

@ andre.m -

I’ve installed sdk ver 4.3, but, I can’t still see that method…


#9

@ VB-Daniel -
That method always return false!!!