image

Series

  1. Introduction. https://elbruno.com/2013/07/13/xduino-arduino-vs-netduino-vs-gadgeteer-i/
  2. Example with Arduino. https://elbruno.com/2013/07/15/xduino-arduino-vs-netduino-vs-netgadgeeter-ii-usamos-el-arduino/
  3. Starting with Netduino. https://elbruno.com/2013/07/16/xduino-arduino-vs-netduino-vs-netgadgeeter-iii-empezamos-con-netduino/
  4. Example with Netduino. https://elbruno.com/2013/07/17/xduino-arduino-vs-netduino-vs-gadgeteer-iii-el-ejemplo-con-netduino/

Good.

After the example of the Arduino and the Netduino, today’s up to .net Gadgeteer. We have the same problem as with NETMFGadgeteer, there isn’t an official SDK for Visual Studio 2012. However the solution is similar to the ofNETMF 4.2, I explained it in this post and allows us to have .net Gadgeteer projects in our New Projects of Visual Studio 2012 window (the official link is this).

image

Before turning to the draft code, let’s review the hardware we use for example est.

Once the project is created, we will add to it the following items,

  • FES main Board
  • Power Supply
  • Button
  • Multicolor LED

in the case of Gadgeteer is way graphic with a DSL editor

image

Then the code is quite simple

   1: using GT = Gadgeteer;

   2: using GTM = Gadgeteer.Modules;

   3:  

   4: namespace GadgeteerApp2

   5: {

   6:     public partial class Program

   7:     {

   8:         private bool _ledOn;

   9:  

  10:         void ProgramStarted()

  11:         {

  12:             button.ButtonPressed += button_ButtonPressed;

  13:         }

  14:  

  15:         void button_ButtonPressed(GTM.GHIElectronics.Button sender, GTM.GHIElectronics.Button.ButtonState state)

  16:         {

  17:             if (_ledOn)

  18:             {

  19:                 multicolorLed.TurnRed();

  20:             }

  21:             else

  22:             {

  23:                 multicolorLed.TurnOff();

  24:             }

  25:             _ledOn = !_ledOn;

  26:         }

  27:     }

  28: }

In this case treatment of the LED is a bit special since I have a multi-colored LED. For example, I put it online or OFF.

And ready the last example, tomorrow a little test adapting Groove of Arduino for Gadgeteer sensors.

 

References:

  • Install .net Gadgeteer for VS2012

Saludos @ Home

El Bruno

image image image Google

One response to “[#XDUINO] Arduino vs Netduino vs Gadgeteer (V) example with Gadgeteer”

Leave a reply to [#XDUINO] Arduino vs Netduino vs Gadgeteer (VIII) Links | El Bruno Cancel reply

Discover more from El Bruno

Subscribe now to keep reading and get access to the full archive.

Continue reading