SlideShare a Scribd company logo
Teach computing with
Microsoft .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 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
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.
Modules, Modules, Modules




Sensors, Actuators, Networking, User Input,
Displays, Power, Extensibility, …
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
Connecting mainboards and modules:
          just match the letters




Note: The hardware will not be damaged if the wrong socket is used.
Red modules provide power
Connect only one red module
LETS BUILD A DIGITAL CAMERA
FROM 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
Hack2the future Microsoft .NET Gadgeteer
Module manufacturer
and module type




    Module name
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.
Now: please build a digital camera!
FIRST use the designer to get it as below
and THEN build the hardware
VERY BRIEF INTRODUCTION TO C#
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");
          }
    }
}
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");
        }
    }
}
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.
To access hardware functionality type the name
of the hardware module followed by a period
e.g. myButton.
Properties
Values that can be read, and sometimes also assigned.
Methods
Built-in functions that can include a number of parameters.
Events
Notification that something of interest has occurred.
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.
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.
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.
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.
The quick way to use events
 Type +=, followed by the Tab key twice.
The quick way to use events
Replace the line   throw new NotImplementedException();   with your own
code.
SOFTWARE FOR A DIGITAL CAMERA
When the button is pressed, call the
camera.TakePicture() method.
When the camera has captured a
picture, use the display’s SimpleGraphics
to display the image.
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.
Completed program (comments removed)
Now: Please write your program!
RUNNING THE PROGRAM
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.
After loading messages, output window should display Program Started,

Note: If you can’t see the Output Window, press Ctrl+Alt+O
Click the    button, or press
Shift+F5 to exit the debugging
mode.

Note that you can’t edit the code
while in debugging mode.
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!

More Related Content

PDF
CodePool Liverpool 2013 - Microsoft Gadgeteer Presentation
PDF
Programming Without Coding Technology (PWCT) - Play Flash Movie
PDF
Programming Without Coding Technology (PWCT) - Simple GUI Application
PDF
Programming Without Coding Technology (PWCT) - Add toolbar to the window
PDF
Programming Without Coding Technology (PWCT) - Center Window
PDF
Programming Without Coding Technology (PWCT) - Hello Lily Sample
PDF
Programming Without Coding Technology (PWCT) - Crystal Reports 10
PDF
Programming Without Coding Technology (PWCT) - How to deal with Arrays
CodePool Liverpool 2013 - Microsoft Gadgeteer Presentation
Programming Without Coding Technology (PWCT) - Play Flash Movie
Programming Without Coding Technology (PWCT) - Simple GUI Application
Programming Without Coding Technology (PWCT) - Add toolbar to the window
Programming Without Coding Technology (PWCT) - Center Window
Programming Without Coding Technology (PWCT) - Hello Lily Sample
Programming Without Coding Technology (PWCT) - Crystal Reports 10
Programming Without Coding Technology (PWCT) - How to deal with Arrays

What's hot (6)

PDF
Programming Without Coding Technology (PWCT) - HarbourPWCT - Rectangles - Con...
PDF
Getting touchy - an introduction to touch and pointer events / Frontend NE / ...
PPTX
Vp lecture 10 ararat
PDF
Programming Without Coding Technology (PWCT) - Adding controls to windows.
PDF
Programming Without Coding Technology (PWCT) - Error Handling (Try/Catch)
PDF
Programming Without Coding Technology (PWCT) - Convert the data type of varai...
Programming Without Coding Technology (PWCT) - HarbourPWCT - Rectangles - Con...
Getting touchy - an introduction to touch and pointer events / Frontend NE / ...
Vp lecture 10 ararat
Programming Without Coding Technology (PWCT) - Adding controls to windows.
Programming Without Coding Technology (PWCT) - Error Handling (Try/Catch)
Programming Without Coding Technology (PWCT) - Convert the data type of varai...

Similar to Hack2the future Microsoft .NET Gadgeteer (20)

PDF
Gui builder
PDF
Software engineering modeling lab lectures
PDF
Throughout the semester, we have been working on command line applic.pdf
PPTX
Android testing
PPTX
SPF WinForm Programs
PPTX
GUI components in Java
PDF
step by step to write a gnome-shell extension
PDF
Programming Without Coding Technology (PWCT) - Functions and Procedures
DOC
A d swincc15e
PDF
The java rogramming swing _tutorial for beinners(java programming language)
PDF
The java swing_tutorial
PPTX
Chapter 1
PPTX
Spf chapter 03 WinForm
PPTX
intro_gui
PPT
Python is a high-level, general-purpose programming language. Its design phil...
PDF
Programming Without Coding Technology (PWCT) - Timer control
PPT
Session4 J2ME Mobile Information Device Profile(MIDP) Events
PDF
Programming Without Coding Technology (PWCT) - HarbourPWCT - Hello World - Co...
PDF
PDF
Introduction to CATIA (KEY) - CAD/CAM
Gui builder
Software engineering modeling lab lectures
Throughout the semester, we have been working on command line applic.pdf
Android testing
SPF WinForm Programs
GUI components in Java
step by step to write a gnome-shell extension
Programming Without Coding Technology (PWCT) - Functions and Procedures
A d swincc15e
The java rogramming swing _tutorial for beinners(java programming language)
The java swing_tutorial
Chapter 1
Spf chapter 03 WinForm
intro_gui
Python is a high-level, general-purpose programming language. Its design phil...
Programming Without Coding Technology (PWCT) - Timer control
Session4 J2ME Mobile Information Device Profile(MIDP) Events
Programming Without Coding Technology (PWCT) - HarbourPWCT - Hello World - Co...
Introduction to CATIA (KEY) - CAD/CAM

More from Lee Stott (20)

PDF
Cortana intelligence suite for projects & hacks
PDF
Project Oxford - Introduction to advanced Manchine Learning API
PPTX
Visual studio professional 2015 overview
PDF
Azure cloud for students and educators
PDF
Getting coding in under a hour with Imagine Microsoft
PDF
Create and manage a web application on Azure (step to step tutorial)
PDF
Setting up a WordPress Site on Microsoft DreamSpark Azure Cloud Subscription
PPTX
Imagine at Microsoft - Resources for Students and Educators
PPTX
Porting unity games to windows - London Unity User Group
PPTX
Visual Studio Tools for Unity Unity User Group 23rd Feb
PPTX
Unity camp london feb 2015
PPTX
Marmalade @include2014 Dev leestott Microsoft
PDF
E book Mobile App Marketing_101
PDF
Game Republic 24th April 2014 - Maximising your app revenue
PDF
Updateshow Manchester April 2014
PDF
Microsoft Office for Education
PDF
Microsoft Learning Experiences Skills and Employability
PDF
Game Kettle Feb 2014 Gateshead
PDF
GamesWest 2013 December
PDF
Microsoft Graduate Recuirtment postcard
Cortana intelligence suite for projects & hacks
Project Oxford - Introduction to advanced Manchine Learning API
Visual studio professional 2015 overview
Azure cloud for students and educators
Getting coding in under a hour with Imagine Microsoft
Create and manage a web application on Azure (step to step tutorial)
Setting up a WordPress Site on Microsoft DreamSpark Azure Cloud Subscription
Imagine at Microsoft - Resources for Students and Educators
Porting unity games to windows - London Unity User Group
Visual Studio Tools for Unity Unity User Group 23rd Feb
Unity camp london feb 2015
Marmalade @include2014 Dev leestott Microsoft
E book Mobile App Marketing_101
Game Republic 24th April 2014 - Maximising your app revenue
Updateshow Manchester April 2014
Microsoft Office for Education
Microsoft Learning Experiences Skills and Employability
Game Kettle Feb 2014 Gateshead
GamesWest 2013 December
Microsoft Graduate Recuirtment postcard

Recently uploaded (20)

PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PPT
Teaching material agriculture food technology
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Big Data Technologies - Introduction.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
A Presentation on Artificial Intelligence
PDF
Approach and Philosophy of On baking technology
PPTX
Spectroscopy.pptx food analysis technology
MIND Revenue Release Quarter 2 2025 Press Release
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Unlocking AI with Model Context Protocol (MCP)
Teaching material agriculture food technology
Encapsulation_ Review paper, used for researhc scholars
Big Data Technologies - Introduction.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Digital-Transformation-Roadmap-for-Companies.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Diabetes mellitus diagnosis method based random forest with bat algorithm
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Encapsulation theory and applications.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Review of recent advances in non-invasive hemoglobin estimation
Building Integrated photovoltaic BIPV_UPV.pdf
The AUB Centre for AI in Media Proposal.docx
A Presentation on Artificial Intelligence
Approach and Philosophy of On baking technology
Spectroscopy.pptx food analysis technology

Hack2the future Microsoft .NET Gadgeteer

  • 1. Teach computing with Microsoft .NET Gadgeteer Lee Stott, Steven Johnston
  • 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.
  • 5. Modules, Modules, Modules Sensors, Actuators, Networking, User Input, Displays, Power, Extensibility, …
  • 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.
  • 8. Red modules provide power Connect only one red module
  • 9. LETS BUILD A DIGITAL CAMERA FROM SCRATCH IN 30 MINUTES
  • 11. Designer Tab Solution Explorer (Program.gadgeteer) (Project Files)
  • 13. Designer Tab (Program.gadgeteer) Toolbox
  • 15. Module manufacturer and module type Module name
  • 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.
  • 23. Properties Values that can be read, and sometimes also assigned.
  • 24. Methods Built-in functions that can include a number of parameters.
  • 25. Events Notification that something of interest has occurred.
  • 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.
  • 32. SOFTWARE FOR A DIGITAL CAMERA
  • 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.
  • 36. Completed program (comments removed) Now: Please write your program!
  • 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!