Sunday, May 3, 2015

Windows 10 IoT for Raspberry Pi 2




Microsoft has officially give access Windows 10 support for the Raspberry Pi 2 Coming through on their February announcement that they’d be offering the OS for the diminutive.
With the installed release, you can now build and deploy apps from a Windows 10 PC running Visual Studio.

Download and install the latest build, and get settled into your shiny new operating system. the download page.
Next, you’ll need to install the freeVisual Studio 2015 Preview. Once that’s up and running, you’ll have everything you need on your PC to start playing with Windows 10 IoT Core on Raspberry Pi 2. When you install the preview, be sure to do a custom install and choose the Tools and Windows SDK for Windows 10.

Set Up the Raspberry Pi 2
Head over to Windows IoT and choose Raspberry Pi 2. Follow the instructions on the Raspberry Pi page to:
  • Download the Windows_IoT_Core_RPI2_BUILD.zip file and extract it. If you see an empty list of downloads on the download page, follow the instructions at the top of this page to sign up for the Microsoft Connect program.
  • Use the dism.exe command shown on the setup page to deploy the image to the card. You cannot write the image to the card using dd or any other disk imager; it will not work because dism prepares the partitions on the card as well as copies files.
  • Install the SD card, connect your peripherals, and plug your Pi into the same Ethernet network that your Windows 10 computer’s connected to. If your computer has an Ethernet port, you may be able to connect them directly. The PC setup page, which should be your next stop, has some tips on configuring connection sharing if you do a direct Ethernet connection between your PC and Pi.
Blink LED
The first time you power on the Pi, the activity LED will flash for a few seconds, then stop for a couple minutes. After Windows finishes its initial configuration, the LED should start flashing again, and you should see the Ethernet link lights come on as well.
You are all set up now: you’ve installed Windows 10 Insider Preview on your PC, along with Visual Studio 2015 Release Candidate, the Windows 10 SDK, and WindowsDeveloperProgramForIoT.msi package. If your Windows machine can see the Raspberry Pi, you’re good to go to the next step, Blink an LED.
Little Coding:
You’ll want to download all the samples from the MS-IOT Github repository. After you have them downloaded and unpacked on your hard drive, navigate to the Blinky->CS subdirectory to find the C# Blink example. Double-click Blinky.csproj to open it in Visual Studio. You may get a warning about opening projects from random places on the Internet. Toss caution to the wind and open it up! Next, do the following:
  • In the Solution window, open the Mainpage.xaml folder and double-click the Mainpage.xaml.cs file to open it. This is the main program, and you’re going to make a change to it: 
  • Scroll down to the bottom of the file, and change the value of LED_PIN to 47. This is the onboard activity LED, and saves you from having to connect an LED (you can do that later if you’d like!):
  • Next, look for the toolbar options to the right of Debug. Make sure that ARM is selected, and change Device to remote machine. If your Pi doesn’t appear in the list, paste in its IP address here and change Authentication mode to None, then click Select:
  • “Device” will change to “Remote Machine” in the toolbar. Click the green play button to the left of “Remote Machine”, wait a bit, and your onboard LED should be blinking!


Conclusion
When you downloaded that Github repository, you got a bunch more examples to play with. Happy hacking!





No comments:

Post a Comment