New post for Windows 10 and Raspberry Pi 2 series
- Hardware and software (1 on N)
- Boot from SD card in the device (2 of N)
- Hello World mode! (3 of N)
- Visual Studio deployment process and Web Management app (4 on N)
- Hello Blinky !!! (5 on N)
- Some admin tasks, like change password and change name (6 on N)
- List of connected devices in the Raspberry Pi 2 (7 on N)
- Deploy an app using the deploy package (8 on N)
After the last post is pending to see a little more in depth what you can do with Windows IoT Core and a device, if you want to interact with some sensors in digital mode.
In today’s post I’ll show you what is known as the Hello world in the world of makers: make a led to blink in a device. For this demo, I am using the Grove Raspberry Pi Starter Kit that allows me prototype quickly to these scenarios. In this example, I use one which brings the Starter Kit using a LED on pin 4.
In the previous post I explained how to create a Universal App, in this case we follow the following steps with the exception that in the MainForm, we will add a timer with the following code.
At every tick of the timer change the State of the LED on Pin 4 of ON to OFF, then ON, etc. To be able to begin interaction with the digital Pins of the device, we need to add a reference in our project to Windows IoT Extension SDK
Once added the reference we can add the code necessary to interact with the LED, it is similar to the following
Now we can already deploy the app in our Raspberry Pi. Remember the important thing is to change the platform to ARM, rather than X 86
After a few seconds the app it is already running, see how led begins its flashing
The source code for this solution is available on Github
Saludos @ Madrid
Grove Raspberry PI StarterKit, http://www.seeedstudio.com/depot/GrovePi-Starter-Kit-for-Raspberry-Pi-p-2240.html?cPath=122_154_151