#VS2015 – Publish in Visual Studio Gallery the installer for the Delete all comments in a file with #Roslyn sample extension #VSGallery

Hola!

Final post for the series

Delete all comments in a file with #Roslyn

Create a VSIX installer for the Delete all comments in a file with #Roslyn sample extension

Publish in Visual Studio Gallery the installer

In my last post I described how to create a VSIX package for our delete comments solution. In today post I’ll describe the steps to publish this installer in Visual Studio Gallery.

We need to login into Visual Studio Gallery, https://visualstudiogallery.msdn.microsoft.com/. I’ll use the same account I use in MSDN forums. Let’s start with the [UPLOAD] option

A 3 steps wizard will help us in this process. For this sample I’ll chose the TOOL type

Next step is to define the download type>

– An external Url

– Upload the VSIX file

I’ll choose the 2nd option and I’ll find the next exception:

You can only upload template VSIX files for the Visual Studio Express SKUs.

This error is raised because the default VSIX project template includes a couple of install targets which are not valid for Visual Studio Gallery.

So we leave only VSPro as Install Target.

We need to rebuild and upload again the VSIX file. If we found some build errors, maybe we need to upgrade the version number of our VSIX package.

And we get to the Step 3 of the Publish process. In this step we need to complete the information related to the product, like the source code repository Url of the cost category.

And that’s it! Our extension is available to download from https://visualstudiogallery.msdn.microsoft.com/fe657c84-2077-4092-8063-2cc9587ad0d1

The source code is available in GitHub https://github.com/elbruno/Blog/tree/master/ElBruno.RemoveComments%20V02

Saludos @ Madrid

/El Bruno

References

– Delete all comments in a file with #Roslyn https://elbruno.com/2015/08/17/vs2015-delete-all-comments-in-a-file-with-roslyn/

– Create a #Vsix installer for the Delete all comments in a file with #Roslyn sample extension https://elbruno.com/2015/08/29/vs2015-create-a-vsix-installer-for-the-delete-all-comments-in-a-file-with-roslyn-sample-extension/

– MSDN VSIX Manifest Designer https://msdn.microsoft.com/en-us/library/ee943167.aspx

– MSDN Shipping Visual Studio Extensions https://msdn.microsoft.com/en-us/library/ff363239.aspx

– MSDN Walkthrough: Publishing a Visual Studio Extension https://msdn.microsoft.com/en-us/library/ff728613.aspx

– Creative Commons CC BY http://creativecommons.org/examples#by

– SyncFusion Metro Studio 3 http://www.syncfusion.com/downloads/metrostudio

#VS2015 – Publicar la extensión que borra todos los comentarios utilizando #Roslyn en Visual Studio Gallery #VSGallery

Hola!

Post final para la serie:

Borrar todos los comentarios en un Click con #Roslyn

Crear un instalador para la extensión que borra todos los comentarios utilizando Roslyn

Publicar el paquete en Visual Studio Gallery

En el post anterior vimos cómo crear un instalador VSIX para nuestra solución para eliminar comentarios. Hoy veremos cómo publicar el mismo en Visual Studio Gallery.

En primer lugar debemos acceder a la home de Visual Studio Gallery, https://visualstudiogallery.msdn.microsoft.com/. Necesitamos estar autenticados, en mi caso utilizaré la misma cuenta que utilizo en los foros MSDN. A continuación debemos seleccionar la opción [UPLOAD]

En este momento veremos un asistente con un par de pasos para identificar nuestra extensión. En el caso de este ejemplo, definimos el tipo como TOOL

El siguiente paso es definir si queremos poner un link hacia una página de descarga o subir el paquete VSIX nosotros mismos. Vamos con la 2da opción, y nos encontramos con este hermoso error:

You can only upload template VSIX files for the Visual Studio Express SKUs.

La plantilla por defecto de proyectos VSIX incluye varios targets que no son válidos para Visual Studio Gallery.

Eliminamos los targets de tipo Express y dejamos solo el target para VSPro.

Ahora es momento de recompilar y subir nuevamente nuestro archivo VSIX. En el caso de tener errores de compilación, tal vez sea necesario incrementar el número de versión del VSIX. Y ya podemos completar el último paso para publicar nuestras extensión. En este paso completaremos o modificaremos los valores propios de la extensión para la Visual Studio Gallery. Por ejemplo, en este punto podemos poner la Url con el repositorio de código fuente o definir el precio de nuestra extensión.

Y listo! Nuestra extensión está disponible para descargar desde https://visualstudiogallery.msdn.microsoft.com/fe657c84-2077-4092-8063-2cc9587ad0d1

El código del ejemplo se puede descargar desde GitHub en https://github.com/elbruno/Blog/tree/master/ElBruno.RemoveComments%20V02

Saludos @ Madrid

/El Bruno

References

– Borrar todos los comentarios en un Click con #Roslyn https://elbruno.com/2015/08/17/vs2015-borrar-todos-los-comentarios-en-un-click-con-roslyn/

– Crear un instalador para la extensión que borra todos los comentarios utilizando #Roslyn https://elbruno.com/2015/08/29/vs2015-crear-un-instalador-para-la-extension-que-borra-todos-los-comentarios-utilizando-roslyn/

– MSDN VSIX Manifest Designer https://msdn.microsoft.com/en-us/library/ee943167.aspx

– MSDN Shipping Visual Studio Extensions https://msdn.microsoft.com/en-us/library/ff363239.aspx

– MSDN Walkthrough: Publishing a Visual Studio Extension https://msdn.microsoft.com/en-us/library/ff728613.aspx

– Creative Commons CC BY http://creativecommons.org/examples#by

– SyncFusion Metro Studio 3 http://www.syncfusion.com/downloads/metrostudio

#VS2015 – Create a #Vsix installer for the Delete all comments in a file with #Roslyn sample extension

Hola!

Some people asked about how hard is to create an Installer for the simple in the post “#VS2015 – Delete all comments in a file with #Roslyn”. Is very easy, so I´ll write a couple of posts with the answer to the question and also later, on how to publish this one to the Visual Studio Gallery.

Let’s start from last post, we go back to the source code and we found 2 projects:

ElBruno.RemoveComments, Roslyn source code to delete all comments

ElBruno.RemoveComments.Vsix, this project is our main one, is the one in charge to create the VSIX package

We need to edit the manifest to define the properties of our extension. The main fields I’ll complete are these ones:

Product Name, Product Id, Author, Version, Description, Language, Preview Image: easy very easy

License: I’ve created one in Creative Commons official page. I copied the generated license in a text file and added into the solution.

Icon: thanks SyncFusion Metro Studio 3 !!!

Getting Started Guide, More Info URL: Easy again, a couple of links to my blog

Important: If you need more information about these fields, please go to MSDN [VSIX Manifest Designer] in the references section.

Let-s go to generate our VSIX package, let´s build the Project in RELEASE mode, and we can get the installer in the output folder

When we run the Vsix Installer, we’ll see the information defined in previous steps.

And a couple of seconds later, we get this extension up and running in our IDE !!!

I’ll describe the steps on how to publish to Visual Studio Gallery, in a future post

As always, source code available in GitHub https://github.com/elbruno/Blog/tree/master/ElBruno.RemoveComments%20V02

Saludos @ Madrid

/El Bruno

References

– Delete all comments in a file with #Roslyn https://elbruno.com/2015/08/17/vs2015-delete-all-comments-in-a-file-with-roslyn/

– MSDN VSIX Manifest Designer https://msdn.microsoft.com/en-us/library/ee943167.aspx

– Creative Commons CC BY http://creativecommons.org/examples#by

– SyncFusion Metro Studio 3 http://www.syncfusion.com/downloads/metrostudio

#VS2015 – Crear un instalador para la extensión que borra todos los comentarios utilizando #Roslyn

Hola!

Como algunas personas me preguntaron qué tan complicado era crear un paquete de instalación para el ejemplo “#VS2015 – Borrar todos los comentarios en un Click con #Roslyn”, hoy mostraré los pasos a seguir para crear el paquete de instalación y publicar el mismo en Visual Studio Gallery.

Comenzamos desde el punto anterior, donde podíamos ver que la solución contiene 2 proyectos:

ElBruno.RemoveComments, con el código específico de para eliminar los comentarios

ElBruno.RemoveComments.Vsix, este proyecto es el que se encarga de crear el paquete de instalación VSIX

En el proyecto de VSIX editaremos el manifiesto para completar la información del mismo . Los campos principales que completaremos son los siguientes:

Product Name, Product Id, Author, Version, Description, Language, Preview Image: son auto descriptivos

License: he generado una de tipo Creative Commons en la página oficial. Luego he creado un archivo de texto con la misma, y la he agregado a la solución.

Icon: generado con SyncFusion Metro Studio 3

Getting Started Guide, More Info URL: estas son fáciles, las he tomado de los posts que he escrito en mi blog

Importante: Una descripción completa se puede encontrar en el link de MSDN [VSIX Manifest Designer] en la sección de referencias.

El siguiente paso es generar nuestro paquete de instalación, para esto compilamos el proyecto VSIX en RELEASE, y en la carpeta de compilación podremos encontrar el instalador

Si lanzamos el instalador, veremos los detalles que definimos en los pasos anteriores

Y en pocos segundos, ya tenemos el instalador como parte de nuestro IDE

En el próximo post de la serie mostraré como publicar el paquete en Visual Studio Gallery

El código del ejemplo se puede descargar desde GitHub en https://github.com/elbruno/Blog/tree/master/ElBruno.RemoveComments%20V02

Saludos @ Madrid

/El Bruno

References

– Borrar todos los comentarios en un Click con #Roslyn https://elbruno.com/2015/08/17/vs2015-borrar-todos-los-comentarios-en-un-click-con-roslyn/

– MSDN VSIX Manifest Designer https://msdn.microsoft.com/en-us/library/ee943167.aspx

– Creative Commons CC BY http://creativecommons.org/examples#by

– SyncFusion Metro Studio 3 http://www.syncfusion.com/downloads/metrostudio

[#AZURE] HowTo: Publish a #ClickOnce application using and #AZURE website

image

Buenas,

 

Today he has a tutorial on those fast which I hope to save you some time, instead of investigating how to do it.What we want to do is simple: publish a WPF application with ClickOnce using a website of Azure as our point of distributing and updating. We are going with the step by step.

1. AZURE portal (www.azure.com) create a new item of type “COMPUTE / / WEB SITE / QUICK CREATE”.

image

2. For this demo created website is identified with http://elbrunoclickonce.azurewebsites.net .

3. AZURE ready, now go to Visual Studio 2012 and create a new WPF Application project. In this case I’ve called it “ElBrunoClickOnce”.

image

4. This step is optional but comes in handy to test our deployments, we will show the version number of the deployment of ClickOnce in the MainWindow title.

5. We add a reference to System.Deployment.

6 We modify the code of the MainWindow

   1: using System.Windows;
   2:  
   3: namespace ElBrunoClickOnce
   4: {
   5:     public partial class MainWindow : Window
   6:     {
   7:         public MainWindow()
   8:         {
   9:             InitializeComponent();
  10:             DisplayVersion();
  11:         }
  12:  
  13:         private void DisplayVersion()
  14:         {
  15:             var version = string.Format("assembly: {0}", ((System.Reflection.AssemblyFileVersionAttribute)
  16: (System.Reflection.Assembly.GetExecutingAssembly().
  17: GetCustomAttributes(typeof(System.Reflection.AssemblyFileVersionAttribute), 
  18: false)[0])).Version);
  19:  
  20:             if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
  21:             {
  22:                 System.Deployment.Application.ApplicationDeployment ad =
  23:                 System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
  24:                 version = string.Format("ClickOnce: {0}", ad.CurrentVersion.ToString());
  25:             }
  26:             Title = version;
  27:         }
  28:     }
  29: }

7. If we run the application we will see the version number by default of the Assembly

image

8. Now that we have our application, we will proceed to publish the same in Azure website. For this, we will first add a project ASP.Net MVC 4 to our solution. In this case I called it “ElBrunoClickOncePublish”.

image

9. Inside of the new project we created a folder called “install”

image

10. Now we will publish our web project to Azure. Luckily the friends of Microsoft have done more easier and, with each new upgrade of AZURE. We’re going for the easy way of all: we select our project Web, deplegamos the context menu and select “Publish”

image

11. Then select a profile for the publication. You can download this profile from the AZURE of our website management console.

image

12. A more simple, available since the last update of AZURE, method is to select “Import” and select the target website using our credentials of AZURE,.

image

13. Once imported profile we can follow the step by step Publishing Wizard. The final step allows us to make a preview of the items to publish and launch the publication.

image

14. Once published we can see the site online

15. Now we are going to configure ClickOnce deployment. We access the WPF project properties and in the Publish section we complete the following values:

Publishing Folder:…\ElBrunoClickOncePublish\install\ (this configuration publishes ClickOnce files directly to the Web site project directory)

Installation Folder: http://elbrunoclickonce.azurewebsites.net/install/

image

16. In the updates section, we defined that our application should be validated by new versions before launching and define again the upgrade path.

image

17 We complete the settings in the section “Options”

image

18 It is important to define a publication for our project page, in this case > publish.htm

image

19 And we’re ready, click “Publish Now” and launched a publication.

20. When you have finished publishing, selected the option to show all files in the web project and see that the ClickOnce publishing elements are inside the folder “install”

image

21 Add them as part of the website and launched a publication to AZURE from our website.

image

22. Our url of publication is ready, in this case it is http://elbrunoclickonce.azurewebsites.net/install/publish.htm, if we sailed it we will see that we have the installation of our app page.

image

23. An important detail. As I haven’t used any “good” certificate for the publication, at the time of install Win8 warns us that this may be a software of dubious origin. As in this case, it comes from my own, select the option “more info” and then “run anyway”

image

24. Then we can install the application.

image

25 Then again validate the security, already we can see our application running and displaying the ClickOnce version number.

image

26. Now we will generate a new version of the WPF app. We do a publish it again and we will see in the web project, we have 2 versions

image

27. Now we add to the project the generated version and I aconsejor remove the previous version. (I.e. AZURE, the space is paid!)

image

28. Publish our web project back to AZURE and if we navigate the installation page will see that it has been updated.

image

29. Now, try ClickOnce. We launched the application and see that we have an available update.

image

30. We apply the update, a pair of security warnings and ready! We have the updated version

image

And only 30 steps Risa

Saludos @ Home

El Bruno

image image image

[#AZURE] HowTo: Publicar una aplicacion ClickOnce en un website de Azure

image

Buenas,

hoy toca un tutorial de esos rápidos que espero que te ahorre un poco de tiempo, en lugar de investigar como hacerlo. Lo que queremos hacer es simple: publicar una aplicacion WPF con ClickOnce, utilizando un website de Azure como nuestro punto de distribución y actualización. Vamos con el paso a paso.

1. En el portal de AZURE (www.azure.com) creamos un nuevo elemento de tipo “COMPUTE // WEB SITE / QUICK CREATE”.

image

2. Para esta demo el website creado se identifica con http://elbrunoclickonce.azurewebsites.net.

3. Listo AZURE, ahora vamos a Visual Studio 2012 y creamos un nuevo proyecto de tipo WPF Application. En este caso la he llamado “ElBrunoClickOnce”.

image

4. Este paso es opcional pero viene bien para probar nuestros despliegues, mostraremos el número de versión del despliegue de ClickOnce en el título del MainWindow.

5. Agregamos una referencia a System.Deployment.

6. Modificamos el código del MainWindow

   1: using System.Windows;

   2:  

   3: namespace ElBrunoClickOnce

   4: {

   5:     public partial class MainWindow : Window

   6:     {

   7:         public MainWindow()

   8:         {

   9:             InitializeComponent();

  10:             DisplayVersion();

  11:         }

  12:  

  13:         private void DisplayVersion()

  14:         {

  15:             var version = string.Format("assembly: {0}", ((System.Reflection.AssemblyFileVersionAttribute)

  16: (System.Reflection.Assembly.GetExecutingAssembly().

  17: GetCustomAttributes(typeof(System.Reflection.AssemblyFileVersionAttribute), 

  18: false)[0])).Version);

  19:  

  20:             if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)

  21:             {

  22:                 System.Deployment.Application.ApplicationDeployment ad =

  23:                 System.Deployment.Application.ApplicationDeployment.CurrentDeployment;

  24:                 version = string.Format("ClickOnce: {0}", ad.CurrentVersion.ToString());

  25:             }

  26:             Title = version;

  27:         }

  28:     }

  29: }

 

7. Si ejecutamos la aplicación veremos el número de versión por defecto del ensamblado

image

8. Ahora que tenemos nuestra aplicación, procederemos a publicar la misma en website de Azure. Para esto primero agregaremos un proyecto de tipo ASP.Net MVC 4 a nuestra solución. En este caso lo he llamado “ElBrunoClickOncePublish”.

image

9. Dentro del nuevo proyecto creamos una carpeta llamada “install”

image

10. Ahora publicaremos nuestro proyecto web a Azure. Por suerte los amigos de Microsoft lo han hecho cada vez más fácil, con cada nuevo upgrade de AZURE. Vamos por el camino más fácil de todos: seleccionamos nuestro proyecto Web, deplegamos el context menu y seleccionamos “Publish”

image

11. A continuación debemos seleccionar un perfil para la publicación. Podemos descargar este perfil desde la consola de administración de AZURE de nuestro website.

image

12. Un método más simple, disponible desde el último update de AZURE, es seleccionar “Import” y con nuestras credenciales de AZURE, seleccionar el website de target.

image 

13. Una vez importado el perfil podemos seguir el asistente paso a paso para la publicación. El paso final nos permite hacer un preview de los elementos a publicar y lanzar la publicación.

image

14. Una vez publicado podemos ver el site online

 

15. Ahora vamos a configurar el despliegue de ClickOnce. Accedemos a las propiedades del proyecto WPF y en la sección Publish completamos los siguientes valores:

Publishing Folder: ..\ElBrunoClickOncePublish\install\ (Esta configuración publica los archivos de ClickOnce directamente al directorio de proyecto del website)

Installation Folder: http://elbrunoclickonce.azurewebsites.net/install/

image

 

16. En la sección updates, definimos que nuestra aplicación deberá validar por nuevas versiones antes de lanzarse y definimos una vez más la ruta de actualización.

image 

17. Completamos los valores de la sección “Options”

image

18. Es importante definir una página de publicación para nuestro proyecto, en este caso > publish.htm

image

19. Y ya estamos listos, presionamos “Publish Now” y lanzamos una publicación.

20. Cuando ha terminado la publicación, en el proyecto web seleccionamos la opción de mostrar todos los archivos y vemos que los elementos de la publicación de ClickOnce están dentro de la carpeta “install”

image

21. Los agregamos como parte del website y lanzamos una publicación a AZURE de nuestro website.

image

22. Nuestra url de publicación ya está lista, en este caso es http://elbrunoclickonce.azurewebsites.net/install/publish.htm, si navegamos la misma veremos que tenemos la página de instalación de nuestra app.

image

23. Un detalle importante. Como no he utilizado ningún certificado “bueno” para la publicación, al momento de instalar Win8 nos avisa que este puede ser un software de procedencia dudosa. Como en este caso procede de mi mismo, seleccionamos la opción ”more info” y luego “run anyway”

image

24. Luego ya podemos instalar la aplicación.

image

25. Luego de validar nuevamente la seguridad, ya podemos ver nuestra aplicación funcionando y mostrando el nro de versión de ClickOnce.

image

26. Ahora vamos a generar una nueva versión de la app WPF. Hacemos un publish de la misma nuevamente y veremos que en el proyecto web, tenemos las 2 versiones

image

27. Ahora agregamos al proyecto la versión generada y yo aconsejor eliminar la versión anterior. (Esto es AZURE, el espacio se paga!)

image

28. Publicamos nuevamente nuestro proyecto web a AZURE y si navegamos la página de instalación veremos que la misma se ha actualizado.

image

29. Ahora bien, probemos ClickOnce. Lanzamos la aplicación y vemos que tenemos un update disponible.

image

30. Aplicamos el update, un par de warnings de seguridad y listo !!! tenemos la versión actualizada

image

Y solo en 30 pasos Risa

Saludos @ Home

El Bruno

image image image

[#NETMF] HowTo: Create a motion sensor (II)

image

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

With the following diagram

image

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

image image image

[#NETMF] HowTo: Crear un sensor de movimientos (II)

image

Buenas

en el post de ayer comenté sobre un accesorio para detectar movimientos utilizando .Net Gadgeteer. Hoy veremos como con un par de líneas de código más, podemos activar la cámara para que en el momento que se detecta movimiento, saque una foto y la muestre en el display gráfico.

Para este ejemplo utilizaremos

 

Con el siguiente diagrama

image

Y luego en el código veremos que

  • – cuando se detecta movimiento se indica a la cámara que saque una foto (línea 21)
  • – cuando la cámara saca una foto, la misma se muestra en el display gráfico
   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: }

En los próximos posts veremos como enviar esta información a un procesador de movimientos, e inclusive … pues como montarlo con un modelo cliente / servidor.

Saludos @ Home

El Bruno

image image image

[#NETMF] HowTo: Create a movements sensor (I)

image

Buenas

today’s example does not attempt to replace a Kinect, or much less. However shows us that with a small hardware little more than €12, can create a sensor’s movements when it detects movements, begin to record the input from a camera.

On this basis, we started with the following hardware for example, where we will see the simple which can be create a Motion Detector

with these three elements, we connect the same guided by the following scheme

image

At this point, with the connected sensor we work with it is pretty simple.

Line 10 shows us that we have an event Motion_Sensed () that is activated when the sensor detects motion.

   1: using Gadgeteer.Modules.GHIElectronics;

   2: using Microsoft.SPOT;

   3:  

   4: namespace GadgeteerApp14

   5: {

   6:     public partial class Program

   7:     {

   8:         void ProgramStarted()

   9:         {

  10:             motion_Sensor.Motion_Sensed += MotionSensorMotionSensed;

  11:         }

  12:  

  13:         void MotionSensorMotionSensed(Motion_Sensor sender, Motion_Sensor.Motion_SensorState state)

  14:         {

  15:             Debug.Print("motion detected !");

  16:             // also check >> motion_Sensor.SensorStillActive

  17:         }

  18:     }

  19: }

Well, we can subscribe to this event or can change the focus and do a PULL of the status of the sensor. For this second case we check the Boolean value of the property SensorStillActive (line 15).

The sensor is quite small and has a range of about 7 meters according to official indications that we can readhere .

image

In the next post, add a camera and keep the contents of it on an SD card.

Saludos @ Home

El Bruno

image image image

[#NETMF] Intro or presentation and a free gift with tutorial for a Hello Valentino (my version of Hello World)

image

Buenas

after presenting yesterday .Net micro Framework, today we will see more in detail. Net Gadgeteer .

. Net Gadgeteer (starting from now-GT) is an Open Source platform based on .NET micro Framework (NETMF). If you sound Arduinoyou will surely also sound Netduino that is the same idea but based on NETMF. The point where WP differs is that hardware makers create pieces that are assembled in a plug-and-play mode with a motherboard. This makes not only be fun create gadgets, but it is rather simple since there is to worry about the connection of peripherals. The heart of GT is a EMX module which has a bit of everything: RAM, an ARM processor, ethernet, etc. Good thing is that it is modified to be able to forget the connections. The following image shows a motherboard where not have left space for any sensor. (And Yes, that big time below is a touch display to “hostea” WPF apps… or almost)

Note: here are more than 100 sensors and different motherboards to see what you can create with GThttp://www.netmf.com/gadgeteer/showcase.aspx?showcaseid=1

Software

If you entered the curiosity, the only thing you have to know is that the following software prerequisites you need to get started:

  1. Microsoft Visual C# Express 2010

    You can still use professional or ultimate.

  2. Microsoft .NET Micro Framework 4.2 QFE2 SDK

    This SDK must be installed before step three.

  3. GHI Software Package v4.2 Feb. 18, 2013

    Includes NETMF and .NET Gadgeteer SDKs and components. See release notes and known issues .

Note: these are the official, every 2 months it is best to view them directly inhttp://www.ghielectronics.com/support/.net-micro-framework

The next thing is to give a review for the next free eBook:

Beginners Guide to C# and the .NET micro Framework
http://www.ghielectronics.com/downloads/FEZ/Beginners%20guide%20to%20NETMF.pdf

They are 60 pages that really help you start with WP.

And you are ready to write your first application. In this case and for the following examples we will use sensors that come with the Kit “FEZ Spider Starter Kit“:

Creating the first application

We have the hardware, we have the software, it’s time to create the first Hello World ;) .

1 Open Visual Studio 2010. (in another post commented why VS2010 and not VS2012)

2. Create a new project of type Visual C# / / Gadgeteer / /. Net Gadgeteer Appication (NETMF 4.2)

image

3. In VS2012 all available sensors for use see a DSL with a FEZ Spider, a small tip plate and on the toolbar.

image

4 We add an element of type Button.

5. Then from the single connector of the Button, we connect with the motherboard. An important point is that the designer will provide us the correct slots for connection.

image

6. Once connected we will have something similar to…

image

7. Now let’s add a PowerPoint (or power point) Joh!. We connect it automatically and will have the following:

image

8. Now we can start coding. If we clean of comments and spam clean of this example code is as follows:

   1: using Microsoft.SPOT;
   2:  
   3: namespace GadgeteerApp2
   4: {
   5:     public partial class Program
   6:     {
   7:         void ProgramStarted()
   8:         {
   9:             Debug.Print("Program Started");
  10:         }
  11:     }
  12: }

9 As in an app C# of the always have intellisense, inline help, etc. We are including a button behaves like a button;)

image

10 And then we can already add the Valentino “Hello”

   1: using Gadgeteer.Modules.GHIElectronics;
   2: using Microsoft.SPOT;
   3:  
   4: namespace GadgeteerApp2
   5: {
   6:     public partial class Program
   7:     {
   8:         void ProgramStarted()
   9:         {
  10:             button.ButtonPressed += ButtonButtonPressed;
  11:             Debug.Print("Program Started");
  12:         }
  13:  
  14:         void ButtonButtonPressed(Button sender, Button.ButtonState state)
  15:         {
  16:             Debug.Print("Hello Valentino !!!");
  17:         }
  18:     }
  19: }

11. Amazing simple. Now I have to assemble the toy to prove it “live”

image

Note: thats behind a Xbox Remote (no model that creak me) and also a mate, what we have Argentines abroad

12 Runs in each click of the button, we have the message in the Output window.

image

 

Saludos @ Home

El Bruno

image image image