Using the US Surface Pro 4 Keyboard in the UK

I really like my Surface Pro 4 keyboard. Especially the fingerprint sensor bit, which makes unlocking my device very easy. Unfortunately the fingerprint sensor enabled version of the keyboard is not available in the UK. Fortunately I'm presently in the 'states and I've been able to get hold of one from the Microsoft Store here.

The bad news is that it is, of course, a keyboard with the US layout. The good news is that it is extremely easy to change keyboard layouts in Windows 10. The first thing you need to do is make sure that your machine has both languages installed. Go to Settings> Time and Language

If you're missing the USA language option just press the + and add English(United States). Then, whenever you call up the keyboard you can select the language to use by calling up the on-screen keyboard and  pressing the key in the bottom right. Then, pick your language. The change takes effect immediately and it means that I can swap between my docked keyboard (UK) and my Pro 4 keyboard (US).

The only snag is that of course some of the keys are in different places, but I'm getting better at adapting....

WiFi on Windows 10 Raspberry Pi

I've been playing with Windows 10 on Raspberry Pi for a while. It works really well. It is now my weapon of choice for proper embedded applications.

The Arduino is lovely for tiny apps, but if you find yourself adding SD card interfaces and network adapters and displays you might as well move up to the Pi and get the benefit of C#, Visual Studio and a properating system like Windows 10. 

Up until now I've been tied to a network cable as the previous versions of the Windows 10 Raspberry Pi platform didn't support WiFi. But the latest one does. You have to use the "official" Raspberry Pi WiFi interface, but as this is one of the cheapest (at six pounds) I don't see this as a problem. 

I've added one to my Pi and it works fine. The only problem I've found is that at the moment it doesn't support WiFi connections using the "organisation" authentication that we have at work on the campus network. However, it works fine at home my my domestic network. If you are writing Windows 10 applications for Raspberry Pi you should get one of these for each of your systems. They also raise the lovely prospect of properly powerful connected applications. 

Reading Raspberry Pi inputs using C# in Windows 10

The LogoBlaster and its buttons

The LogoBlaster and its buttons

I had a lot of fun making my Windows 10 LogoBlaster. At the heart of the program is code that responds to the buttons that are pressed to select the required command. These are wired to inputs on the Raspberry Pi. It turns out that some of the inputs have pull up or pull down resistors, which helps keep the wiring simple.

I used the pins that have Pull Down resistors on them. These resistors do what the name implies. They pull the voltage on the input pin down to the ground level. The diagram above shows how this works. The Pull Down resistor connects the input port to the ground level, which means that if the switch is open the signal at the port is 0. But when the switch is closed it pulls the input port up to the power supply voltage, causing the signal at the input port to rise to 1.

If you don't have the pull down resistor (i.e. you let the input port pin wave about in the air with nothing connected to it until the button is pressed) you run the risk of induced voltages leading to spurious input signals. Sometimes you have to actually add your own resistors to the circuit, but in the case of the Raspberry Pi they are built into the hardware so all I had to do was connect the input port in to the switch. There is a table here which tells which pins have pull ups and which have pull downs.

        const int B1Pin = 12;  // wired to pin 32
        const int B2Pin = 13;  // wired to pin 33
        const int B3Pin = 16;  // wired to pin 36
        const int B4Pin = 26;  // wired to pin 37

These are GPIO pin numbers I used for each of my buttons.  Note that the GPIO numbers used by the software don't correspond to the pin numbers on the header on the Raspberry Pi, but I've put these in as comments.

var gpio = GpioController.GetDefault();
GpioPin nextColorPin = gpio.OpenPin(B1Pin);
nextColorPin.DebounceTimeout = new TimeSpan(0, 0, 0, 0, 20);
nextColorPin.ValueChanged += nextColorPin_ValueChanged;

...

private void nextColorPin_ValueChanged(GpioPin sender,
                    GpioPinValueChangedEventArgs args)
{
    if (nextColorPin.Read() == GpioPinValue.High)
    {
        command = DisplayCommands.NextColour;
    }
}

This is the code that sets up and uses the pin. Note that I set a debounce timeout of 20 milliseconds. This is there because the switches that I used were a electrically noisy and sent quite a few extra ones and offs when they were pressed.

The handler for the pin works very like a normal XAML button, in that it generates events when the input pin changes state. The  code in the event handler checks to see if the pin has changed to the high state (which means that the button has been pressed) and if it has it sets a command value to change the display colour. The code is repeated for the other buttons which select the different commands

A Big Hello to Windows 10

I've been running the preview releases of Windows 10 on one of my computers and I've been quite impressed. And now I've got Windows 10 on my "proper" machine, my Surface Pro 3. It's very impressive. Boots fast and the user interface improvements make a huge difference. My advice for would-be migrators.

  • Do it. I don't think you'll regret it. And if you do, it is very easy to revert back to your previous system. I've actually done the revert after I did something stupid during an upgrade and it took me right back to my original system in around five minutes.
  • Give the machine time to settle down after Windows 10 has installed. Once the Windows 10 upgrade has worked its magic you get a whole slew of processes wanting to come in and tidy up. The Search Indexer, the Antimalware process and OneDrive will all want to do considerable amounts of twiddling on your new system. This can ruin user interface performance for a while as the hard disk gets hammered. But give it an hour or on its own so with a decent network connection and you'll see performance go back to previous levels.
  • The Edge browser is awesome. Very, very snappy. In fact unfeasibly fast. And it seems to be compatible with lots of websites sites too. It works a lot better that Internet Explorer with the page editor for my Squarespace website, which is nice. Try it even if your weapon of choice is Chrome or Firefox.
  • If your machine hasn't got much disk space you can recover quite a lot by using System Cleanup to get rid of your old Windows installations (see above). Of course, if you clear away this backup there is no way to return to the previous version but on very constrained machine you probably won't have a choice about doing this. I've upgraded my ultra-cheap Linx machine (very successfully) and got back three or so precious GBytes by doing this.

It will be very interesting to see where Windows 10 ends up. And I reckon that you really should go along for the ride.

Windows 10 Celebration fun and frolics

Well, that was nice. Turns out that Microsoft can build operating systems and also organise great parties. We got there a couple of hours before the doors opened and got everything working just in time for the start. I was responsible for the "Lift Off" game and the LogoBlaster. The Lift Off game has one or two gameplay issues, but I was surprised (and pleased) to find that some folks worked out how the game worked and then got very competitive.....

The LogoBlaster worked incredibly well. This is my pairing of a Raspberry Pi running Windows 10 and a portable video projector. We ere using it to project Windows 10 logos on passers by. 

It was interesting to notice that some folks didn't really get what it was doing until I showed them where the pictures were coming from. We managed to get the Raspberry Pi to load the LogoBlaster program on boot up, so that the unit became completely wire free. I was able to happily wander round adding logos to passing people.

Demonstrating the power of Logo Blaster

Demonstrating the power of Logo Blaster

Adding cheese to the surroundings

Adding cheese to the surroundings

Shameless self promotion - and a hexapod robot

Shameless self promotion - and a hexapod robot

The best moment came when we pointed the LogoBlaster  at someone's head by mistake. And the results were awesome. He (I'm awfully sorry sir - I've forgotten your name) was even happy to pose for a while as we took some more pictures.

This came out really well. I've put a whole bunch more pictures on Flickr. You can find them here.

The event ran for four hours. By the end we were all thoroughly hoarse from talking to folks about what we had done. But it was wonderful. We packed up in double quick time and staggered back to the hotel. Thanks to Paul for inviting me and letting me be part of this event. Great fun. 

Put "Windows 10 on Everything" with my LogoBlaster

I've just arrived at the hotel where we're staying for the Windows 10 celebration event. I've unpacked a few gadgets...

I'm helping out on the Internet of Things front, and on Sunday night I had a great idea for a device I could demonstrate.  Which I've built. In 36 hours. Go me.

I call it the "Windows 10 Logo Blaster". It really can put "Windows 10 on everything". It's a Raspberry Pi coupled to my lovely little projector. It runs a Windows 10 application that lets you select logos and images to "blast" onto the surroundings.

These are the 3D printed components. A tray for the Raspberry Pi, a cover that supports the projector and a handle which contains the trigger buttons. I've learned a bit over the years, and I now make designs that are easy to construct. As opposed to ones which can contain the components, but you can't actually get them inside.....

You can see how it all fits together here. Its showing the Windows 10 boot screen on the wall. When the program is running it shows different logos that you can switch between by pressing the buttons on the handle.

It works a treat. Battery life isn't great, but it does work. And I really can put Windows 10 (or at least one of its logos, onto everything. Tonight we've been told to wear white shirts as part of the event dress code, which should make the images show up a treat........

I'll put the designs and the software up on Github when I get back to Hull. I'm amazed that we now have tools and software that will let me go from idea to product in such a short time.

I'm really looking forward to the event tonight. I just hope everything works.......

Rob at the Windows 10 Celebration Event in London

Paul has invited me down to the Windows 10 celebration event in London on the 29th next week. I'm really flattered to be asked. I'll be helping with some embedded stuff, running Windows 10 on Raspberry Pi devices.

I'm a Microsoft MVP, so you'd expect me to like Windows 10. But I really do. I've had it on my of my older Surface devices for a while and I've watched it "grow up" over the successive releases.

To be honest, I've always found Windows 8.1 to be pretty good, but Windows 10 is even better. It boots really fast, works with all my Windows applications and has some nice extra features. And the new browser really points towards the future.

The event is at Old BillingsGate Market on Wednesday evening.  Looking forward to it.  If you are coming along, seek me out. I'll be in the iot part of the event.

Windows 10 on Raspberry Pi

Windows 10 on Raspberry Pi works. In fact it works very well. You can deploy programs from Visual Studio 2015 into the Pi and they just run. You can even put breakpoints in the code while it is running, and remotely debug your code over an IP connection. Just like the "Good Old Days" (tm) when I was putting.NET Microframework code into embedded devices all those years ago. Except that Pi applications have proper .NET behind them and I can build a user interface using WPF.

The hardware connections are abstracted into classes, just like they should be:

const int LED_PIN = 5;
var gpio = GpioController.GetDefault();
GpioPin pin = gpio.OpenPin(LED_PIN);

This makes a pin that the program can use to interact with the outside world.

pin.Write(GpioPinValue.Low);

This sets the pin low.  A program can read and write the status of the pin and bind to events that fire when the pin changes state. This makes embedded development really easy.

Installation was smooth enough, although you'll need a PC running Windows 10 with Visual Studio 2015 RC to get started.

The walkthroughs are well written and accurate. You can get started here:

http://ms-iot.github.io/content/win10/SetupPC.htm

 One tip, if you have any problems getting Visual Studio to work after installation go to this page:

https://dev.windows.com/en-US/downloads/windows-10-developer-tools

Scroll to the bottom of the page and install "Standalone Windows SDK for Windows 10" and "Microsoft Emulator for Windows 10 Mobile". This fixed a few problems I had with stuff not installing properly.

I'm properly excited about this. I'm going to have a go at getting my Galileo to run Windows 10 as well. There are also bindings for frameworks that can talk over Bluetooth to Arduino devices.

Update: Turns out that Galileo doesn't run Windows 10 core, it uses the previous version of Windows. Apologies for any confusion.

RGB LED Panel Magic

Some time back I got some of these SparkFun LED panels. I hooked one up to an Arduino and got impressive results, although just driving the pixels took pretty much all the power that the Arduino had. I had this plan to use a Parallax Propeller chip or maybe something from Xmos to create a fast moving animated display. But I never got around to it.

Then I found out about the SmartMatrix Shield for the Teensy 3.1 device. This sorts out all the wiring and power supply issues (all you need is something that can spit out 5 volts at a couple of amps). The Teensy is a quite amazing machine. It pops a 72Mhz processor with 64K of RAM and 260K of ROM onto a platform the size of an Arduino Pro. The development tools integrate straight into the Arduino environment and the deployment to the device works wonderfully, far better than a "proper" Arduino.

TodayI set about building my display. Everything fits into an 8 inch picture frame that I got from HobbyCraft.

You can see it all above. The Teensy and the SmartMatrix Shield are at the bottom of the picture. I've also attached an SD card and an IR receiver that allows remote control of the display.  There's a really good set of step-by-step instructions on the AdaFruit site. I designed and printed some corner brackets to position the panel inside the frame, you can get them from Thingiverse here.

The Teensy runs the Aurora software which is completely wonderful. it produces some really lovely displays. I've had to hack it slightly to get it to work with a remote control I happened to have lying around. The display is excellent, and photographs just can't do it justice.

One other nice surprise was that I did all this on my old Surface Pro that is now running Windows 10. It took all these strange programs and usb devices in its stride and just worked. I'm looking forward to adding some more visualisations and searching down some animated gifs to play on the device.

Old Surface Pros, Windows 10 and Spartan

I've been running Windows 10 on an old Surface Pro 1 and it works a treat. I installed it from a USB key. I really wanted a clean install but the Windows 10 setup insisted on doing a (very successful) upgrade of the existing Windows 8.1 installation. However, by forcing a refresh I managed to get an empty machine to play with.

It's very snappy. Boot times put my Windows Phone to shame and it seems very complete and stable. I upgraded to the latest version so I could try the new "Spartan" browser. I was interested to see if it could render my blog home page and the editing environment that Squarespace provides. It works great. Takes a while to wind up but once it is going it all seems fine.

I've also done lots of things that I wasn't expecting to work very well, like connecting to network printers at the office and installing strange usb drivers. So far Windows 10 is looking like a win.

Windows 10 Phone Edition First Impressions

The settings screen has had a serious makeover

The settings screen has had a serious makeover

Well, right on time, as promised, we get a technical preview edition of Windows 10 for the phone in February.  The only problem is that it doesn't work on my Lovely Lumia 1520. This is a technical thing involving the size of the boot images and phone internal storage. I reckon this is fair enough. The only problem is that I really want to have a go. Enter a bright orange Lumia 630 into my life.

You can pick up unlocked versions of these from Amazon for well under 100 pounds and they are actually a smashing little phone. They have nice things like a removable back and exchangeable battery, along with a socket for an SD card to boost the rather internal memory.  They can also run the Windows 10 Technical Preview.  Yay!

The install process was easy enough. I did it over the afternoon, just checking every now and then to see if the progress bars had moved any. You just install the Windows Insider application (you can find it here)  then follow the instructions. There's a "red pill - blue pill" moment where you have to choose between bleeding edge or an older but slightly better supported preview version (I went for bleeding edge - of course) but after that everything runs on rails. Microsoft really are getting good at rolling out over the air updates. 

And when it has all finished you are left with the latest build of Windows 10 on your phone. And you can play "spot the difference". Lots of things look exactly the same, almost certainly because they are exactly the same just at the moment. The Settings menu has had a makeover, the keyboard is a bit different, there's a file explorer and you have to configure the phone to the US region of you want Cortana. 

From the point of view of Microsoft I think it makes very good sense to use the lower spec. phones to start with. If things run OK on the slower devices they are going to run really well on the larger ones. In fact the quality of the experience on the Lumia 630 brings out a problem that Microsoft have with flagship devices. Just what do you make the flagship do that sets it apart from the very acceptable behaviour of this low cost Lumia?

I was very pleased to find that Cheese Lander works fine on the phone, as has much everything else I've tried. I've had a few freezes in Internet Explorer but nothing that would stop me from using this phone as my daily driver. The interface is a bit choppy sometimes and there are occasional flashes of red screen as the video catches up, but it all works fine. I'm really looking forward to seeing how the system evolves in the future. 

Windows 10 Looks Wonderful

I wasn't able to watch much of the live presentation about Windows 10 today. We were down at Fudge having a really nice meal at a bargain price, thanks to their January seat sale (my tip, have the quiche - like a pie but without the lid, and a fantastic filling).

Anyhoo, I managed to capture the gist of the event, sneaking peeks of a live blog from the event on my phone in between courses. Which is probably the epitome of bad manners, but I really wanted to find out what was going on. 

It was awesome.

Some perspective here. I'm a Microsoft MVP. I like Microsoft stuff. So you would expect me to say nice things about stuff that comes from Redmond. But even so it was awesome.

There was a great balance between stuff that you can see fitting in with your life (universal apps that are built once and run on every platform in an appropriate way, Continuum that makes sure that you get the best experience whatever device you are using, Cortana everywhere, playing Xbox One games on your tablet/phone) and completely bonkers stuff that might just change your life completely (the Holographic headset). 

I've read up what I can on the headset and the only thing I truly, definitely know about it just right now is that I really, really want one. It is definitely a work in progress. I'm not sure that Microsoft can tell us exactly how they see it being used in the future. But kudos to the company for unveiling it as they did. If you want to watch back the event you can find it here

Microsoft now have compelling hardware, compelling software and real proper science fiction stuff. The next year is going to be very interesting.