Windows for Devices: Turn your Intel Galileo into a thermometer

This experiment is my first foray into the “internet of things” space using the Galileo Gen 1 board I got back in September. I decided to read the temperature in the room with a TMP36 thermometer sensor and then ultimately feed those readings into Azure. This is the first blog post outlining the steps to build a thermometer sensor out of your Galileo. There will be subsequent posts outlining the connection into Azure, so stay tuned!

If you’re interested in learning more about Windows for Devices, you can visit the portal here. From there, you can sign up for the preview program and learn more about it.

Parts list:

  • A Galileo Gen 1/Gen 2 board running the latest Windows for Devices image(as of this writing is 141114-1440)
  • TMP36 Thermometer component – link
  • Breadboard
  • 5 breadboard jumper wires
  • A LAN cable for connecting to the Galileo from your PC for debugging remotely from Visual Studio
  • Visual Studio 2013 Community Edition with the latest Windows for Devices SDK

First things first, if you have a Galileo board and haven’t set anything up yet, I recommend the setup tutorials on the portal before you get started here – Make sure you install the latest Windows image!

Take a look at the diagrams below to learn how to wire up the temperature sensor.



Now that you have that all wired up, it’s time to write some code to read from the sensor.

There are three steps that are critical to getting an accurate temperature reading –

  1. Reading the analog signal from the TMP36 Vout pin, which in my case, is connected to A0, or analog pin zero, on my Galileo – the raw signal has a resolution of 10 mV / degree centigrade and a 500 mV offset for negative temperatures – source
  2. Converting the analog reading to a voltage value – it is critical to know the operating voltage of the sensor. For this example, I am using 5.0 V.
  3. Converting that voltage to Celsius

Code for these steps

[snippet id=”10032″]

[snippet id=”10033″]

[snippet id=”10034″]

We’ll use these methods in our sketch loop to read and convert the values.

[snippet id=”10035″]

The code for the project is part of an overall solution to hook into Azure Event Hubs – you can get the complete solution from GitHub –

My first 5K with Microsoft Band

These are my first impressions of using the Microsoft Band during a 5K race.

Let me start by saying that I didn’t find the Microsoft Band the least bit uncomfortable. However, I am a relatively big person with large wrists (6′ 3″, 205 lbs.), so others may have a different experience. This was also my first 5K race in over 10 years, so don’t knock my performance too much!

My current verdict

The Microsoft Band is a well-designed fitness tracker with great app integration and real-world value. I can already tell that is was a worthwhile gadget investment and is leaps and bounds a better experience than the FitBit Flex that I used to wear.

Here’s how it went…


Little preparation was required. The band just needed a little charge this morning before I left the house, so when I got up this morning, I charged my Band for about 40 minutes. It started with 40% charge and was at about 80% when I took it off the charger. If you plan to use the onboard GPS chip to enable GPS tracking for your runs, it is important to note that you need enable GPS for your runs by opening the run app and swiping to the right to the toggle.

During the Race

You start a run by opening the run tracking app on your Band and pressing the action button. From there, you can press the action button again to pause the run and then ether resume or end it. This is a pretty standard user experience for these types of applications. What I failed to see was the prompt asking if I wanted to start tracking the run while it was still trying to lock a GPS signal, which required a second press of the action button, so I didn’t actually start the tracking until about .25 miles into the run. I suppose it would’ve helped to read the instructions beforehand. My preference would be for it go ahead and start tracking and then add GPS when it has a lock without requiring a second interaction.

After I got the run tracking enabled, the Band, by default, showed a nice display of calories, heart rate and total time elapsed – if you swipe down from the top, there is a little overlay screen that shows GPS status, pace time, and distance.

Something that I think I noticed (I could be crazy) was that the Band gave me a nice little haptic buzz at every mile marker. I don’t know if this is only done during GPS tracking or it will also happen during a normal run, but it is a good little reminder of how you’re progressing through your run. This replaces the audible function that most run tracking apps have and is a nice touch.

You end the run by pressing the action button and selecting “End”. It took me a few seconds to remember to End the run after crossing the finish line. What can I say? I was in the zone.

After the Race

This is where I think the Microsoft Band and its integration with the Microsoft Health app really shine. After I retrieved my phone from my car, I let the Band sync with my phone and then opened the app on my Nokia Lumia 1520. To my elation, it had a very detailed recounting of my run starting with a summary that included a map of my run. Presumably this map only shows up after runs with GPS tracking enabled.

If you tap on the map, it opens it full screen. The really nice part of the map, is that it has a color map of what your speed was like during the run. You can see where I turned up the heat on the last stretch. It also has mile markers, so you can see where exactly those distances were achieved. The snail and cheetah icons in the color map key are also a nice touch.

The other screen is splits, which is figures out for you automatically, which is nice. Other apps I’ve used leave it up to you to split manually.

One other note on the run summary screen – all the way at the bottom, there are three options – share, delete and rename. I chose to rename the event, so I can log it officially. I also chose to share it on Facebook and I am perplexed as to why Twitter sharing is not available. Hopefully, that will show up in a future update.

Also, I noted that at the beginning of the race my Band had a charge of 79% and afterwards, had dropped to 71%, so it would seem that GPS tracking does drain the battery much faster as expected and is stated in the product manual.

Overall, color me impressed from my first outing with the Microsoft Band in a fitness scenario. The integration between the Band and the Microsoft Health app is top notch and I found the band to be both comfortable and very useful for tracking my run. I can see how using the Microsoft Band and the accompanying app will lead to greater insights into my training to becoming a better runner. Based on my experience this time around, I think it is time to retire Runtastic and finally stop lugging my giant phone with me on runs.

Plus! I stopped at Starbucks on my home and used the Starbucks card app to pay. It works flawlessly and usually starts up a conversation with the person working the register and anyone behind or in front who happens to see you use it.

TAMUHack Winners!


TAMUHack was a Major League Hacking event held at Texas A&M University on October 24th and 25th. It was the first MHL hackathon held at the university and it was met with great enthusiasm.

Congratulations to the team that I helped who were building a VR game in Unity. They ended up winning 3rd place overall at the hackathon and that is a picture of them with me at the top of the article.

Microsoft sponsored the hackathon and provided prizes for the most creative use of Azure cloud services.

I was astonished at the creativity of the projects at the hackathon and there were some very creative hacks that were able to use the Azure platform to enable the cloud portion of their applications. The uses ranged from hosting websites in Azure website to uploading data to Azure Blob storage.

Azure Projects

Here are the projects that leveraged Azure during the hackathon with the winners highlighted.

  • WebBro(our big winner) – a chrome browser extension that allows users to leave comments on a website even if the website doesn’t have a built-in comment system. Think crows-sourced comments. We felt this was a very creative project and solves a problem on the web in a very creative way.
    • Team members – Arun Krishnakumar, Anirudh R, and Brandon Jackson
    • Their use of Azure included
      • Azure web site exposing PHP web service.
      • Persist data in MySQL on Azure.
      • Automatic deployment through Github.
    • Each team member won a Microsoft Universal Mobile Keyboard
    • You can also install the extension via the Chrome web store –
  • Projections(runner up) – Retrieving, and analyzing, and reporting Fortune 500 data from Bloomberg. This was a very polished, well-rounded web application. It was a close call between this one and WebBro.
    • Team – Jeffrey Zhao, Son Pham, Benny Yan, Ian Macalinao, and Klayton Wittler
    • Their use of Azure
      • Created Ubuntu VM; connected to Bloomberg VPN. Deployed Java backend app.
  • OcuLeap – Use Leap motion gestures to navigate world map; Oculus Rift displays photos at selected location. The technology uses WebGL for rendering to Oculus.
  • GitBrub – a crowd-sourced repository for food recipes.
    • Team – Justin Emig, Wasim Wadhwani, Logan Collins
    • Their use of Azure
      • Installed “Bottle” micro framework on Azure VM
  • BudgetByte – Web app calculates the maximum calories for a given restaurant and budget.
    • Team – Garrett Whitehorn, Magan Tyler, Chris Gillis, and Harrison Golden
    • Their use of Azure
      • Hosting PHP site in Azure Web Sites
  • SecureStore – Secure storage and sharing of photos.
  • Satyakiran Duggina – Capture American Sign Language gestures with Kinect and translate message.
    • Team – Satyakiran Duggina
    • Use of Azure
      • Deployed app to VM
      • Storing videos in blob storage

Computer Visionaries 2014 – Incredible success!

Computer Visionaries 2014 was a Kinect for Windows hack-a-thon sponsored by Microsoft and the Kinect for Windows team that took place on July 18th and 19th in Dallas, TX.

First of all, it was my pleasure to work with Skip Howard, and the other volunteers from the Computer Vision – Dallas group, to bring the Kinect team to Computer Visionaries 2014 in Dallas! I hope all involved had a great time and a big shout out to The DEC for hosting us in their newly opened facility in the Dallas West End.

How it all started

When we contacted Ben Lower to come down to speak at the Computer Vision – Dallas user group in July, we had no idea that it would blow up into a full blown hack-a-thon! We talked to Ben and he said, “Let’s do something big – it is Dallas after all, where everything is BIG”. So, we went from a simple speaker request to a full blown hack-a-thon on just a few weeks.

From there, we planned the event, marketed the event and drove ticket sales up to 128 the day of the event in just 7 weeks! This speaks volumes about the level of trust, commitment and enthusiasm Microsoft has from the developers in Dallas/Ft. Worth and surrounding areas and I couldn’t be more proud to be a part of that community.

The Event

We had 114/128 registered attendees show up to hack on the Kinect sensor. That is an 89% show rate, which is nearly unheard of for any kind of developer event. This number doesn’t account for the numerous visitors we had come through to see the projects in addition to our guest judges. This to me, shows that the developers, entrepreneurs, makers, and overall tech enthusiasts in the DFW area recognize the potential that Kinect has to change the way we interact with our computers in a day-to-day basis and are truly enthused to be a part of that future.

The event attracted an impressive mixture of attendees – we had programmers, artists, designers, web traffic specialists, local entrepreneurs, composers, DJs, hobbyists, makers, gamers, attorneys, college students, high school students, middle school students, professors, teachers, and a CEO or two snuck in to see what was happening.

At the end, 15 teams presented their projects on Saturday night in front of the judging panel. The projects ranged from scanning your body measurements, detecting head nods for paraplegics on into video games and educational apps. The ideas, innovation and level of execution on these projects was nothing short of amazing and mind-blowing. I could tell by how long it took the judges to come out with the results, that their job was indeed difficult in choosing the winners.


In the end, the event was a contest, so we had to have clear winners.

1st Place

Team: Dallas Society of Play

Project: Super Dueling Golem Dudes

Members: Daniel Fairley, Jim Welch

Prize: $500 in cash and a Kinect V2 sensor each


2nd Place

Team: Kinectergarten

Project: Kinectergarten

Members: Phil Denoncourt, Anthony, Erik Leaseburg, Jason Eads, Kamila, Chris Ford

Prize: $250 cash and a Kinect V2 sensor

3rd Place

Team: Burger ITS

Project: Put Me in Space

Members: Shawn Weisfeld, Theresa Burger, Robert Burger, Harold Pulcher, Corey Drew, Alisson Drew, Taylor Wooley, James Porter

Prize: $100 cash and a Kinect V2 sensor

The Judges

A big heartfelt thanks for our guest judges who volunteered their time to participate in the event and help us choose our winners!

From left to right – Dan Ferguson, Gabriela Draney and Caleb Jenkins. Each of which received a shiny new Kinect V2 sensor for helping us out!

Thank you!

Also, a big thanks to everyone who made this event happen – Skip Howard, Ben Lower and the Kinect for Windows team, Dr. Neil Roodyn, Joshua Blake, Jenifer Conley, Nathalie Goh-Livorness, the judges and all of the volunteers who helped check people in and keep the venue clean.

I really hope everyone had a great time at the event and if you have any feedback, please feel free to reach out to me on Twitter or by e-mail.


Jason Fox

Giving Indie Devs a little Spark

Some of you may have seen me talking about BizSpark on Twitter recently or at one of the Day of Unity events that I hosted and are wondering what the program is all about and how can it help indie game developers?

In my personal assessment of the program, I really do think that BizSpark is a great program that goes underutilized in the game developer space. The program gives you access to tools and resource for 3 years to help offset the costs of starting your company. This can be invaluable to startups who could already be lightly bootstrapped or starting off with no funds at all. Anything that helps, right?

So, what is BizSpark?

  • Microsoft BizSpark is a free program dedicated to helping startups, even game devs, succeed.
  • It gives you free access to the software and tools to build amazing games, as well as the technology to get into the cloud.
  • You can also connect to thousands of other startups and game devs and 1,500+ startup organizations around the world.

Benefits include

  • Access to tools and support that your studio might need.
  • Looking into cloud computing? Microsoft Azure has serious potential to help bring your games to the cloud.
  • Cloud computing has almost limitless potential for supporting games. Here are just a few examples of what cloud computing is being used for – hosting game servers, serving out game updates, hosting websites, running your own leaderboard service, running cloud-hosted game logic/AI (think Titanfall). Maybe you have the next gamer services platform that you’re building to sell to other studios?
  • BizSpark gives you $150 in Azure credit per month – this goes a really long way during development with the option of paying if needed.
  • Visual Studio – Whether you’re coding your own engine in C++/C#/VB or HTML/JS or maybe scripting in Unity, then there’s no denying that Visual Studio is an awesome IDE. Visual Studio Tools for Unity is now free!
  • Do you plan on building games for Windows or Windows Phone? Get the latest tools to help you out.
  • Other benefits are also available – free Windows developer account, 90 days trial of pluralsight training and access to many other partner offerings directly through the program.

There are some qualification to joining BizSpark:

  • Are you making games?
  • Is your game studio less than 5 years old?
  • Are you making less than $1 million USD in revenue per year?
  • Is your game studio privately held?

If you can answer YES to all of these questions, then you qualify for the program! If you answered NO to any of these questions, then you don’t qualify. If you don’t qualify, then please spread the word to people you know who might! Let’s get the word out about this great program!

This all sounds awesome! How do I sign up?

There’s two ways to sign up:

  • The slow way – you can visit this link to register– this adds you to the review queue, which can take several days to several weeks to complete, or
  • The fast way – if you answered YES to the questions above, you can e-mail me about your game studio and I can pre-qualify you into the program. Please detail your studio name, or yourself if you publish under your name, what projects you’re working on and include any reference material about your studio or projects like links, screenshots, etc. Once I verify you, I can send a special link via e-mail that automatically enrolls you into the program.

My e-mail:

As always, if you have any questions, please hit me up at or shoot me an e-mail.


Adding a trial experience in your Windows game built with Unity

The case has been made that if you offer a trial mode for your game, then your purchase rate will increase along with the increase in installation footprint. I agree and I know several developers who have increased their game’s revenue by organically growing their install base using a trial mode.

Fortunately, the Windows and Windows Phone stores each make it very simple to implement such an experience. Coupled with Unity who was gracious enough to include a simple API in its platform to check for a trial license from the store platform.

Step 1 – As in game, you will need to decide the basis of your trial experience. Is it going to be:

  • 7 days with unlimited access to features?
  • Unlimited with limited features?
  • Somewhere in between?

***Let me warn you – if you don’t give the player something compelling to do in trial mode, they will *not* purchase your game. I suggesting loading up your search engine of choice – preferably Bing – and doing some research on what works as far as trial experiences.

Once you’ve decided on what your super-awesome trial experience is going to look like, you can start to implement what you need in your code.

Step 2 – On to the code!

As I mentioned above, Unity has included a simple API for probing the license information for the game from the Store platform. I wasn’t able to find any documentation for the API on the Unity docs site, so I’ll just post the code definition here.

using System;
using UnityEngine;

namespace UnityEngine.Windows
    public sealed class LicenseInformation
        public LicenseInformation();

        public static bool isOnAppTrial { get; }

        public static string PurchaseApp();

Somewhere in my game scripts, I will want to query this API to see if I need to setup my game to support trial mode or the player can just proceed with normal gameplay. Typically, in a Unity game, you will have some kind of GameController object that will persist across scenes. That is where I am going to put my code for the sake of this tutorial. So, let’s open that up.

We need to store the status of trial mode in a public static field, so that other scripts that query it to limit features in the game.

    public static bool IsTrial = true;
    void Awake()
        GameObject.DontDestroyOnLoad(this); // cause this object to persist

        IsTrial = UnityEngine.Windows.LicenseInformation.isOnAppTrial;

After I store the state, I can use it to draw a Buy button in my game’s GUI. When the play presses the button, it will call PurchaseApp() to launch the Store purchasing process.

    void OnGUI()
        if (IsTrial)
            if (GUI.Button(new Rect(50, 30, 100, 25), "Buy me!"))
                var receipt = UnityEngine.Windows.LicenseInformation.PurchaseApp();
                IsTrial = false;

At this point, I can’t tell that the string that PurchaseApp returns is anything at all. I get an empty string when I debug, but I am also not debugging against a game that is published in the store. It appears to just be a fire-and-forget style API, so I want to put in some logic to recheck the trial mode state when FixedUpdate runs, but only after 1 second has passed. So, while the app is in trial mode, we will check for a change every 1 second.

    void FixedUpdate()
        if (IsTrial && (Time.realtimeSinceStartup - _lastTrialCheck) >= 1f)
            _lastTrialCheck = Time.realtimeSinceStartup;

            // we'll detect if the trial state has changed
            if (UnityEngine.Windows.LicenseInformation.isOnAppTrial != IsTrial)
                IsTrial = UnityEngine.Windows.LicenseInformation.isOnAppTrial;

That’s it. Hopefully, you have enough information to implement a trial in a Windows game. Remember, make the trail mode fun enough where the players will want to purchase your game to continue playing and to support the great work that you’ve done!


Also, here’s the full source for my GameController class.

using UnityEngine;
using System.Collections;

public class GameController : MonoBehaviour {

    public static bool IsTrial = true;

    private float _lastTrialCheck = 0f;

    void Awake()
        GameObject.DontDestroyOnLoad(this); // cause this object to persist

        IsTrial = UnityEngine.Windows.LicenseInformation.isOnAppTrial;

    void FixedUpdate()
        if (IsTrial && (Time.realtimeSinceStartup - _lastTrialCheck) >= 1f)
            _lastTrialCheck = Time.realtimeSinceStartup;

            // we'll detect if the trial state has changed
            if (UnityEngine.Windows.LicenseInformation.isOnAppTrial != IsTrial)
                IsTrial = UnityEngine.Windows.LicenseInformation.isOnAppTrial;

    void OnGUI()
        if (IsTrial)
            if (GUI.Button(new Rect(50, 30, 100, 25), "Buy me!"))
                var receipt = UnityEngine.Windows.LicenseInformation.PurchaseApp();
                IsTrial = false;

Porting your Unity game to Windows Phone – Part 1

I just wanted to cover some stuff that you need to handle when porting your Unity game to Windows Phone. What’s required to get started and what’s required to pass store certification.

First, let’s cover what’s required to get started.

  • Unity 4.3.3 or higher
  • Windows 8.1 x64(to run the emulator)
  • Visual Studio 2013/2012
  • Windows Phone SDK
  • Developer account

Now, you should already know how to get the latest version of Unity. If not, then you probably shouldn’t be reading this blog post, but rather this getting started page on Unity’s own site.

How do I get the other stuff?

Windows 8.1

Windows 8.1 is installed on most new PCs, so that is one route to go. You can also purchase a copy and install it from here or any other retailer.


If you are a student enrolled at school who has DreamSpark Premium or a startup who has a BizSpark account, you can download Windows 8.1 for free.

Visual Studio

You can always start with the free version of Visual Studio 2012 for Windows Phone found here. You can also take advantage of DreamSpark/BizSpark and download Visual Studio 2013 Ultimate from your associated account (which is what I would do. I mean, why not?)

Windows Phone SDK

If you’re lucky enough to grab a copy of VS 2013 Ultimate, or you decided to use VS 2012 for WP, then the Windows Phone 8 SDK come with both of those by default. If you have another version of visual studio, you can download the SDK as a separate install from here.

Important note about running the emulators – your PC hardware must support hardware-assisted virtualization, SLAT, hardware DEP and have a minimum of 4GB of RAM on top of running Windows 8.1 x64 in order to run the emulator. This should not be an issue with most modern hardware. However, you may need to enable these things in your BIOS.

Developer Account

Again, this is a good place to use your DreamSpark or BizSpark benefits if you have them, since you get a free developer account with each. If it’s just you then you will need to shell out $19 for yourself to register or $99 for your company to register. You can started with that process here. NOTE: to access your free developer account benefit, you will need to grab the code from your DreamSpark/BizSpark account page and enter it in at checkout when registering on the developer account page.

Exporting your game

Once you have all of the tools and that incredibly awesome game that you built, you will want to export the game from Unity into a Visual Studio solution, so that you can build and debug the project. Let’s take a look at that process.

  1. Open File->Build Settings in Unity and select Windows Phone 8. NOTE: If you plan on profiling your game from Unity, then check Development Build to enable that.
  2. Press Build and select an output folder for your game’s Visual Studio Solution. I usually create a folder under my main project folder to hold this output.


Once you get your Visual Studio solution output, you can open it and do a few things to run your game.

If you have a Windows Phone device that you would like to run your game on, make sure it is developer unlocked. If you’ve never done this before, you can follow the instructions found here.

Once your phone is connected to the PC via USB cable, you can build, deploy and debug right from Visual Studio to your device by pressing the Run button.

If you don’t have a Windows Phone device to run on, you can run your game using an emulator. In Visual Studio, simply select this drop-down and select the applicable emulator. As noted above, your machine needs to be capable of running the emulator!

The fun stuff!

…otherwise known as – certification. What do you absolutely have to add to or handle in your game in order to pass store certification? Let’s take a look.

Privacy Policy – If you game accesses the internet for any reason, including advertising, you must have a privacy policy readily available for the player to read – whether it’s hosted directly in your game or just a link to a web-hosted policy. See section 2.7.2 in the certification requirements for more details –

Location Services – if your game makes use of location services, then you not only have to have a privacy policy, then you must provide a way for the user to opt-out without crashing the application. This can simply be a message that tells the player that location is a required game mechanism.

The Back button – Windows Phone requires handset manufacturers to implement a hardware back button for a consistent user experience. Because of this, your game should behave similar to the guidance below in order to pass certification.

  • During gameplay – present a pause menu/dialog or navigate to the previous menu. For example, in a simple game, you may simply want to return to the main menu of your game when the back button is pressed.
  • In the pause menu/dialog – pressing the back button should exit the menu/dialog and resume the game.
  • In the main menu – if the back button is pressed during the main menu, then your game should exit.

Here’s a code sample of handling the back button in Unity


Next post, I will go into adding tailoring the splash screen experience, handling orientation, and pausing and resuming. As always, I welcome any questions in the comments section.