.NET Gadgeteer is a new toolkit for quickly constructing, programming and shaping new small computing devices (gadgets)
Ideal for teaching computer science, engineering, Design and Technology in schools, colleges and universities more details here http://www.netmf.com/gadgeteer/
2. .NET Gadgeteer is a new toolkit for quickly constructing,
programming and shaping new small computing devices
(gadgets)
3. History
• .NET Gadgeteer comes from Microsoft Research in
Cambridge, UK
• Designed as a tool for researchers to make it faster and
easier to prototype new kinds of devices
• Since then, it has proven to be of interest to hobbyists
and for secondary and tertiary education
• Because of this interest, we have launched .NET
Gadgeteer as open source software/hardware
4. The .NET Gadgeteer Hardware
At the heart of every Gadgeteer project is a mainboard.
A mainboard is made up of a programmable processor, and a
number of sockets that Gadgeteer modules can plug into.
6. Today we are using the
GHI Electronics FEZ Spider Kit
Touchscreen Display Camera Multicolor LED Button FEZ Spider Mainboard
Joystick USB Host Ethernet SD Card USB Power Supply
+ Programming Interface
7. Connecting mainboards and modules:
just match the letters
Note: The hardware will not be damaged if the wrong socket is used.
16. When clicking on a module’s socket, To connect the button to a
compatible sockets on the mainboard compatible socket, click and drag
are highlighted in green.
17. Now: please build a digital camera!
FIRST use the designer to get it as below
and THEN build the hardware
19. using System;
using Microsoft.SPOT; The code starts with a
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls; standard template
using Microsoft.SPOT.Presentation.Media;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;
namespace GadgeteerApp1
{
public partial class Program
{
void ProgramStarted()
{
/******************************************************************************************
Access modules defined in the designer by typing their name:
e.g. button
camera1
Initialize event handlers here.
e.g. button.ButtonPressed += new GTM.MSR.Button.ButtonEventHandler(button_ButtonPressed);
***************************************************************************************** */
// Do one-time tasks here
Debug.Print("Program Started");
}
}
}
20. ProgramStarted() executes
whenever the mainboard is first
namespace GadgeteerApp1
{ powered up or restarted.
public partial class Program
{
void ProgramStarted()
{
/******************************************************************************************
Access modules defined in the designer by typing their name:
e.g. button
camera1
Initialize event handlers here.
e.g. button.ButtonPressed += new GTM.MSR.Button.ButtonEventHandler(button_ButtonPressed);
***************************************************************************************** */
// Do one-time tasks here
Debug.Print("Program Started");
}
}
}
21. namespace GadgeteerApp1
{
public partial class Program
{
void ProgramStarted()
{
/******************************************************************************************
Access modules defined in the designer by typing their name:
e.g. button
camera1
Initialize event handlers here.
e.g. button.ButtonPressed += new GTM.MSR.Button.ButtonEventHandler(button_ButtonPressed);
***************************************************************************************** */
// Do one-time tasks here
Debug.Print("Program Started");
}
}
}
Debug.Print(string) prints
text to the debug output
window.
22. To access hardware functionality type the name
of the hardware module followed by a period
e.g. myButton.
26. Events
Notification that something of interest has occurred.
This line specifies that we are interested in knowing when this
particular event occurs, and associates it with a specific method.
27. Events
Notification that something of interest has occurred.
This line specifies that we are interested in knowing when this
particular event occurs, and associates it with a specific method.
28. Events
Notification that something of interest has occurred.
This method will now get called (and the code inside
it will get executed) whenever the button is pressed.
29. The quick way to use events
Inside the ProgramStarted() method, type module name followed
by a period, then select event using the arrow and Enter keys.
30. The quick way to use events
Type +=, followed by the Tab key twice.
31. The quick way to use events
Replace the line throw new NotImplementedException(); with your own
code.
33. When the button is pressed, call the
camera.TakePicture() method.
34. When the camera has captured a
picture, use the display’s SimpleGraphics
to display the image.
35. The DisplayImage method takes three parameters: a
GT.Picture object, an X coordinate and a Y coordinate.
The PicturedCaptured event returns a GT.Picture object,
called picture, which is used as the first parameter.
The coordinate 0, 0 (passed as the second and third
parameters) refers top-left corner of the display.
38. Make sure that the mainboard is
connected to the PC, and that the
power LED is on.
Click the button, or press the
F5 Key to deploy the code to the
mainboard and start a debugging
session.
39. After loading messages, output window should display Program Started,
Note: If you can’t see the Output Window, press Ctrl+Alt+O
40. Click the button, or press
Shift+F5 to exit the debugging
mode.
Note that you can’t edit the code
while in debugging mode.
41. If you see the following message in the output window,
stop debugging (Shift+F5) and try again (F5):
Updating display configuration. DEVICE WILL NOW REBOOT. Visual Studio might lose
connection, and debugging might need to be manually restarted.
If the output window is stuck displaying the following
message, press the reset button on the mainboard:
Rebooting...
Now: Please program your cameras!