Buenas
in the yesterday’s post I commented on an accessory to detect movements using. Net Gadgeteer . Today we will see how with a couple of lines of code more, we can activate the camera when motion is detected, you take a picture and show it in the graphic display.
For this example we will use
- Fez Spider Mainboard
http://savecomm.net/p/53/fez-spider-starter-kit - USB Client DP
http://www.netmf.com/showcase.aspx?ShowcaseID=1 & id = 110 - PIR Module
http://www.ghielectronics.com/catalog/product/357 - Display T35
http://www.ghielectronics.com/catalog/product/276 - Camera
http://www.ghielectronics.com/catalog/product/283
With the following diagram
And then in the code to see that
- When motion is detected tells the camera to take a photo (line 21)
- When the camera takes a photo, it is shown in the graphic display
1: using System;
2: using GT = Gadgeteer;
3:
4: namespace GadgeteerApp15
5: {
6: public partial class Program
7: {
8: void ProgramStarted()
9: {
10: motion_Sensor.Motion_Sensed += MotionSensorMotionSensed;
11: camera.PictureCaptured += CameraPictureCaptured;
12: }
13:
14: void CameraPictureCaptured(GT.Modules.GHIElectronics.Camera sender, GT.Picture picture)
15: {
16: display_T35.SimpleGraphics.DisplayImage(picture, 5, 5);
17: }
18:
19: void MotionSensorMotionSensed(GT.Modules.GHIElectronics.Motion_Sensor sender, GT.Modules.GHIElectronics.Motion_Sensor.Motion_SensorState state)
20: {
21: camera.TakePicture();
22: }
23: }
24: }
In the next posts to see how to send this information to a processor of movements, and even… well as mount with a model client / server.
Saludos @ Home
El Bruno
Leave a comment