image

Buenas

today a post those good, good, good: how to create a camera using. Net Gadgeteer with 22 lines of code.

In this example we will use the following components:

Connected as shown in the image:

image

Now, for what remains of the post I recommend sitting or take a few whiskitos before… This is the source code of the application.

   1: namespace GTPhotoCamera
   2: {
   3:     public partial class Program
   4:     {
   5:         void ProgramStarted()
   6:         {
   7:             button.ButtonPressed += ButtonButtonPressed;
   8:             camera.PictureCaptured += CameraPictureCaptured;
   9:         }
  10:  
  11:         void CameraPictureCaptured(Gadgeteer.Modules.GHIElectronics.Camera sender, Gadgeteer.Picture picture)
  12:         {
  13:             display_T35.SimpleGraphics.DisplayImage(picture, 5, 5);
  14:         }
  15:  
  16:         void ButtonButtonPressed(Gadgeteer.Modules.GHIElectronics.Button sender, Gadgeteer.Modules.GHIElectronics.Button.ButtonState state)
  17:         {
  18:             camera.TakePicture();
  19:         }
  20:     }
  21: }

Simply impressive! a function to request a picture of the camera, and a function to process the same… simplicity above all ;)

Saludos @ La Finca

El Bruno

image image image

a

Leave a comment

Discover more from El Bruno

Subscribe now to keep reading and get access to the full archive.

Continue reading