Browse over 10,000 Electronics Projects

Raspberry Pi 2 with Microsoft Windows 10

Raspberry Pi 2 with Microsoft Windows 10

Listing 1

<Page
x:Class=”App2.MainPage”
xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”
xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”
xmlns:local=”using:App2”
xmlns:d=”http://schemas.microsoft.com/expression/blend/2008”
xmlns:mc=”http://schemas.openxmlformats.org/markup-compatibility/2006”
mc:Ignorable=”d”>
<Grid Background=”{ThemeResource ApplicationPageBackgroundThemeBrush}”>
<TextBlock Foreground=”Blue” HorizontalAlignment=”Center”
VerticalAlignment=“Center” FontSize=“64”>Hello World</TextBlock>
</Grid>
</Page>

 

With respect to the original file, we added a TextBlock, that is to say a control capable of displaying a text. Its colour has been set to blue (with Foreground=“Blue”) and aligned to the center of the page (with HorizontalAlignment=“Center” and VerticalAlignment=“Center”).

Our first Universal App is ready: we may test it out. In the Visual Studio toolbar are the commands to control the App’s execution; as a first test we will execute it on our computer, for the purpose it is enough to click on the run button, that is to say, the small arrow that is similar to a “play” button.

 

IMMAGINE6sistemata



Advertisement1


 

If we didn’t make mistakes, we will see a white page with a nice “Hello World” blue writing, in the center: it is a good result, but our objective was the one to create an App for Raspberry Pi. It is a very short step to get there. Always from the menu we used before, we find a drop down menu that indicates for which architecture to compile our App. As is known, Raspberry Pi is based on ARM technology, thus let’s select this architecture from the menu. Close to the button that we used to execute the App there is a label that claims “Local Computer” and here as well is the small icon, used in order to open a drop down menu.

 

Immagine7sistemata

 

Since we want to execute our code on Raspberry Pi, we have to select “Remote Computer”: a dialogue box will appear, to be used in order to set the board’s IP and the authentication (let’s select none for now). We are be ready again to press the execution button, but this time the App will be directly executed on Raspberry, and we will see the blue “Hello World” label to appear in the center of the monitor connected to the board.

Even if what we developed is something that is very simple from a functional point of view, we reached a very important stage. To be able to execute the App both on the local computer and on the remote device is something very important in the prototyping phase, and it enables a much greater speed, for example, in the interface design stages. Obviously, as we add the functions for the interaction with the board’s hardware to the App, it will be our duty to conditionally manage the presence or the absence of the required devices.

Pages: 1 2 3 4 5 6 7 8

 


Top