Teach computing withMicrosoft .NET Gadgeteer   Lee Stott, Steven Johnston
.NET Gadgeteer is a new toolkit for quickly constructing,programming and shaping new small computing devices(gadgets)
History• .NET Gadgeteer comes from Microsoft Research in  Cambridge, UK• Designed as a tool for researchers to make it fas...
The .NET Gadgeteer HardwareAt the heart of every Gadgeteer project is a mainboard.A mainboard is made up of a programmable...
Modules, Modules, ModulesSensors, Actuators, Networking, User Input,Displays, Power, Extensibility, …
Today we are using theGHI Electronics FEZ Spider KitTouchscreen Display   Camera     Multicolor LED   Button    FEZ Spider...
Connecting mainboards and modules:          just match the lettersNote: The hardware will not be damaged if the wrong sock...
Red modules provide powerConnect only one red module
LETS BUILD A DIGITAL CAMERAFROM SCRATCH IN 30 MINUTES
Development Tool: Visual Studio              or
Designer Tab                      Solution Explorer(Program.gadgeteer)                        (Project Files)
Code Tab(Program.cs)
Designer Tab          (Program.gadgeteer)Toolbox
Module manufacturerand module type    Module name
When clicking on a module’s socket,   To connect the button to acompatible sockets on the mainboard   compatible socket, c...
Now: please build a digital camera!FIRST use the designer to get it as belowand THEN build the hardware
VERY BRIEF INTRODUCTION TO C#
using   System;using   Microsoft.SPOT;                                 The code starts with ausing   Microsoft.SPOT.Presen...
ProgramStarted() executes                                                      whenever the mainboard is firstnamespace Ga...
namespace GadgeteerApp1{    public partial class Program    {        void ProgramStarted()        {            /**********...
To access hardware functionality type the nameof the hardware module followed by a periode.g. myButton.
PropertiesValues that can be read, and sometimes also assigned.
MethodsBuilt-in functions that can include a number of parameters.
EventsNotification that something of interest has occurred.
EventsNotification that something of interest has occurred.            This line specifies that we are interested in knowi...
EventsNotification that something of interest has occurred.            This line specifies that we are interested in knowi...
EventsNotification that something of interest has occurred.This method will now get called (and the code insideit will get...
The quick way to use eventsInside the ProgramStarted() method, type module name followedby a period, then select event usi...
The quick way to use events Type +=, followed by the Tab key twice.
The quick way to use eventsReplace the line   throw new NotImplementedException();   with your owncode.
SOFTWARE FOR A DIGITAL CAMERA
When the button is pressed, call thecamera.TakePicture() method.
When the camera has captured apicture, use the display’s SimpleGraphicsto display the image.
The DisplayImage method takes three parameters: aGT.Picture object, an X coordinate and a Y coordinate.The PicturedCapture...
Completed program (comments removed)Now: Please write your program!
RUNNING THE PROGRAM
Make sure that the mainboard isconnected to the PC, and that thepower LED is on.Click the   button, or press theF5 Key to ...
After loading messages, output window should display Program Started,Note: If you can’t see the Output Window, press Ctrl+...
Click the    button, or pressShift+F5 to exit the debuggingmode.Note that you can’t edit the codewhile in debugging mode.
If you see the following message in the output window,stop debugging (Shift+F5) and try again (F5):Updating display config...
Hack2the future Microsoft .NET Gadgeteer
Upcoming SlideShare
Loading in...5
×

Hack2the future Microsoft .NET Gadgeteer

2,365

Published on

.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/

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,365
On Slideshare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Hack2the future Microsoft .NET Gadgeteer"

  1. 1. Teach computing withMicrosoft .NET Gadgeteer Lee Stott, Steven Johnston
  2. 2. .NET Gadgeteer is a new toolkit for quickly constructing,programming and shaping new small computing devices(gadgets)
  3. 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. 4. The .NET Gadgeteer HardwareAt the heart of every Gadgeteer project is a mainboard.A mainboard is made up of a programmable processor, and anumber of sockets that Gadgeteer modules can plug into.
  5. 5. Modules, Modules, ModulesSensors, Actuators, Networking, User Input,Displays, Power, Extensibility, …
  6. 6. Today we are using theGHI Electronics FEZ Spider KitTouchscreen Display Camera Multicolor LED Button FEZ Spider Mainboard Joystick USB Host Ethernet SD Card USB Power Supply + Programming Interface
  7. 7. Connecting mainboards and modules: just match the lettersNote: The hardware will not be damaged if the wrong socket is used.
  8. 8. Red modules provide powerConnect only one red module
  9. 9. LETS BUILD A DIGITAL CAMERAFROM SCRATCH IN 30 MINUTES
  10. 10. Development Tool: Visual Studio or
  11. 11. Designer Tab Solution Explorer(Program.gadgeteer) (Project Files)
  12. 12. Code Tab(Program.cs)
  13. 13. Designer Tab (Program.gadgeteer)Toolbox
  14. 14. Module manufacturerand module type Module name
  15. 15. When clicking on a module’s socket, To connect the button to acompatible sockets on the mainboard compatible socket, click and dragare highlighted in green.
  16. 16. Now: please build a digital camera!FIRST use the designer to get it as belowand THEN build the hardware
  17. 17. VERY BRIEF INTRODUCTION TO C#
  18. 18. using System;using Microsoft.SPOT; The code starts with ausing Microsoft.SPOT.Presentation;using Microsoft.SPOT.Presentation.Controls; standard templateusing 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"); } }}
  19. 19. ProgramStarted() executes whenever the mainboard is firstnamespace 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"); } }}
  20. 20. 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.
  21. 21. To access hardware functionality type the nameof the hardware module followed by a periode.g. myButton.
  22. 22. PropertiesValues that can be read, and sometimes also assigned.
  23. 23. MethodsBuilt-in functions that can include a number of parameters.
  24. 24. EventsNotification that something of interest has occurred.
  25. 25. EventsNotification 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.
  26. 26. EventsNotification 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. 27. EventsNotification that something of interest has occurred.This method will now get called (and the code insideit will get executed) whenever the button is pressed.
  28. 28. The quick way to use eventsInside the ProgramStarted() method, type module name followedby a period, then select event using the arrow and Enter keys.
  29. 29. The quick way to use events Type +=, followed by the Tab key twice.
  30. 30. The quick way to use eventsReplace the line throw new NotImplementedException(); with your owncode.
  31. 31. SOFTWARE FOR A DIGITAL CAMERA
  32. 32. When the button is pressed, call thecamera.TakePicture() method.
  33. 33. When the camera has captured apicture, use the display’s SimpleGraphicsto display the image.
  34. 34. The DisplayImage method takes three parameters: aGT.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 thirdparameters) refers top-left corner of the display.
  35. 35. Completed program (comments removed)Now: Please write your program!
  36. 36. RUNNING THE PROGRAM
  37. 37. Make sure that the mainboard isconnected to the PC, and that thepower LED is on.Click the button, or press theF5 Key to deploy the code to themainboard and start a debuggingsession.
  38. 38. After loading messages, output window should display Program Started,Note: If you can’t see the Output Window, press Ctrl+Alt+O
  39. 39. Click the button, or pressShift+F5 to exit the debuggingmode.Note that you can’t edit the codewhile in debugging mode.
  40. 40. 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 loseconnection, and debugging might need to be manually restarted.If the output window is stuck displaying the followingmessage, press the reset button on the mainboard:Rebooting...Now: Please program your cameras!

×