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:
- Fez Spider Mainboard
http://www.ghielectronics.com/catalog/product/269 - Display T35
http://www.ghielectronics.com/catalog/product/276 - USB Client DP
http://www.netmf.com/showcase.aspx?ShowcaseID=1 & id = 110 - Button
http://www.netmf.com/showcase.aspx?ShowcaseID=1 & id = 114 - Camera
http://www.netmf.com/showcase.aspx?ShowcaseID=1 & id = 112
Connected as shown in the 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
a
Leave a comment