Jimmy Engström

NAVIGATION

2015

Download all the videos from Build 2015

2015-05-11 17:25:00 +0000

Build 2015 was epic, there was so much content so Microsoft even recorded some content before build (now available at Channel9).
I usually download everything to my laptop and watch it to and from work, this script will download all videos from Build 2015 =)

This is an updated version of my script I previously blogged about here.

cd "d:\build15"

$pattern = "[{0},\:,\']" -f ([Regex]::Escape([String][System.IO.Path]::GetInvalidPathChars()))             
[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath
$a = ([xml](new-object net.webclient).downloadstring("http://s.ch9.ms/Events/Build/2015/RSS/mp4high"))
$a.rss.channel.item | foreach{ 
    $url = New-Object System.Uri($_.enclosure.url)
    $file = [Regex]::Replace($_.Title + " " + $url.Segments[-1] , $pattern, ' ') 
    Write-host  ("{0}  -  {1}" -f "Downloadning" ,$file)
    if (!(test-path $file))
    {
            (New-Object System.Net.WebClient).DownloadFile($url, $file)
    }
}

 

Just copy the code, paste it into a file called “Build2015.ps1”, create a directory (in my case “c:\Build15”) and change the path in the first line of the script.

Right click on the file and choose run with PowerShell.

 

In case you get a problem similar like “Build2015.ps1 cannot be loaded because running scripts is disabled on this system.”

Start PowerShell as an administrator and run “set-executionpolicy unrestricted”, this is probably a bad thing to do for security.

Build2015.ps1 (677.00 bytes)

2014

Controlling an iKettle with Windows phone

2014-06-06 23:15:00 +0000

A week ago I found a kettle that can be controlled over Wi-fi.
It is called iKettle and can be found over here.

When I find a device I look for two things:
Is there an app for Windows (Phone or 8)?
Can I make one?

If the answer is yes to at least one of those questions (well actually none is ok too) I know I need to buy one.

Mark Cox had already done most of the heavy lifting so I only had to implement the protocol found on this blog (Thanks Mark).
I’m a bit sad that it didn’t use http protocol, it could have replied with status 418 Ler

There are still features missing, some because I haven’t gotten around to it yet and some because there are hardware or software limitations, like you won’t be able to set up the iKettle from a Windows phone since you can’t connect directly to it.

</param></embed>
Short app demo


 

Download the app MyKettle


Hope you enjoy the app and if you have any suggestions or comments please let med know.
Still a lot of stuff coming up =D

Windows phone 8.1 and Bluetooth LE – Getting started

2014-05-04 17:03:00 +0000

With Windows phone 8.1 Microsoft also released the ability to communicate with Bluetooth Low Energy devices.
This is really exciting for Windows phone developers, this way we can start developing apps that can talk to devices without draining the battery dry.

Sadly this is not available in the developer preview of Windows phone 8.1, but will be available when Windows Phone 8.1 is released for general availability.

Pairing

The first step is always to pair with the device you want to connect to.
This is easy to do by going to Settings –> Bluetooth on your phone and tapping on the device you wish to pair with, just as you would do with a  “ordinary” Bluetooth device.

 

Capabilities

To be able to communicate with Bluetooth Low energy (or Bluetooth Smart, as it’s also called) you need to add a capability to your app.
This can’t be done from a GUI, you need to edit the package.appmanifest manually and add the following lines of code just above </Package>.

<Capabilities>
  <m2:DeviceCapability Name="bluetooth.genericAttributeProfile">
    <m2:Device Id="any">
      <m2:Function Type="serviceId:1803"/>
    </m2:Device>
  </m2:DeviceCapability>
</Capabilities>

Now you are are set to start coding =)

 

Iterate through devices

To keep this as simple as possible, I’ll just show you how to iterate through devices and pick up a predefined one.

BluetoothLEDevice currentDevice { get; set; }
string deviceName = "Philips AEA1000";
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
    foreach (DeviceInformation di in await DeviceInformation.FindAllAsync(BluetoothLEDevice.GetDeviceSelector()))
    {
        BluetoothLEDevice bleDevice = await BluetoothLEDevice.FromIdAsync(di.Id);
        if (bleDevice.Name == deviceName)
        {
            currentDevice = bleDevice;
            break;
        }
    }
}

Find out what your device can do

GATT (Generic Attribute Profile) provides profile discovery and description services for Bluetooth Low Energy protocol, it basically makes it possible to ask your device what it can do. The documentation for this is very thorough and shows how to communicate.

Here is how to get a list of the GATTServices your device supports.

List<string> serviceList = new List<string>();
foreach (var service in currentDevice.GattServices)
{
    switch (service.Uuid.ToString())
    {
        case "00001811-0000-1000-8000-00805f9b34fb":
            serviceList.Add("AlertNotification");
            break;
        case "0000180f-0000-1000-8000-00805f9b34fb":
            serviceList.Add("Battery");
            break;
        case "00001810-0000-1000-8000-00805f9b34fb":
            serviceList.Add("BloodPressure");
            break;
        case "00001805-0000-1000-8000-00805f9b34fb":
            serviceList.Add("CurrentTime");
            break;
        case "00001818-0000-1000-8000-00805f9b34fb":
            serviceList.Add("CyclingPower");
            break;
        case "00001816-0000-1000-8000-00805f9b34fb":
            serviceList.Add("CyclingSpeedAndCadence");
            break;
        case "0000180a-0000-1000-8000-00805f9b34fb":
            serviceList.Add("DeviceInformation");
            break;
        case "00001800-0000-1000-8000-00805f9b34fb":
            serviceList.Add("GenericAccess");
            break;
        case "00001801-0000-1000-8000-00805f9b34fb":
            serviceList.Add("GenericAttribute");
            break;
        case "00001808-0000-1000-8000-00805f9b34fb":
            serviceList.Add("Glucose");
            break;
        case "00001809-0000-1000-8000-00805f9b34fb":
            serviceList.Add("HealthThermometer");
            break;
        case "0000180d-0000-1000-8000-00805f9b34fb":
            serviceList.Add("HeartRate");
            break;
        case "00001812-0000-1000-8000-00805f9b34fb":
            serviceList.Add("HumanInterfaceDevice");
            break;
        case "00001802-0000-1000-8000-00805f9b34fb":
            serviceList.Add("ImmediateAlert");
            break;
        case "00001803-0000-1000-8000-00805f9b34fb":
            serviceList.Add("LinkLoss");
            break;
        case "00001819-0000-1000-8000-00805f9b34fb":
            serviceList.Add("LocationAndNavigation");
            break;
        case "00001807-0000-1000-8000-00805f9b34fb":
            serviceList.Add("NextDstChange");
            break;
        case "0000180e-0000-1000-8000-00805f9b34fb":
            serviceList.Add("PhoneAlertStatus");
            break;
        case "00001806-0000-1000-8000-00805f9b34fb":
            serviceList.Add("ReferenceTimeUpdate");
            break;
        case "00001814-0000-1000-8000-00805f9b34fb":
            serviceList.Add("RunningSpeedAndCadence");
            break;
        case "00001813-0000-1000-8000-00805f9b34fb":
            serviceList.Add("ScanParameters");
            break;
        case "00001804-0000-1000-8000-00805f9b34fb":
            serviceList.Add("TxPower");
            break;
        default:
            break;
    }
}
MessageDialog md = new MessageDialog(String.Join("\r\n", serviceList));
md.ShowAsync();


Time for some fun, Lets make it beep!

In my case I have a Key finder (key fob) and it implements (among other services) the Immediate Alert Service, which makes it possible to make it beep.
The GATT specification shows us how to communicate with the ImmediateAlertService
Download the PDF here.

image


The documentation shows us that if we want to set the alert level we need to do that with “Write without Response”.
The different values for Alert Level can be found here.

Value 0, meaning “No Alert”

Value 1, meaning “Mild Alert”

Value 2, meaning “High Alert”

This snippet will make the key finder (key fob) sound a high alert.

var immediateAlertService = currentDevice.GetGattService(GattServiceUuids.ImmediateAlert);
var characteristics = immediateAlertService.GetCharacteristics(GattCharacteristicUuids.AlertLevel).First();
byte[] data = new byte[1];
data[0] = (byte)2;
await characteristics.WriteValueAsync(data.AsBuffer(), GattWriteOption.WriteWithoutResponse);

 

In my next blog post I will go through more of the things you can do with a key finder (key fob).

Download all the videos from Build 2014

2014-04-06 04:51:00 +0000

Build 2014 was packed with announcements and fun stuff.
Still have a lot of videos to watch =)

Here is an updated version of my script I previously blogged about here.

cd "d:\build14"

$pattern = "[{0},\:,\']" -f ([Regex]::Escape([String][System.IO.Path]::GetInvalidPathChars()))             
$pattern
[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath
$a = ([xml](new-object net.webclient).downloadstring("http://s.ch9.ms/Events/Build/2014/RSS/mp4high"))
$a.rss.channel.item | foreach{ 
    $url = New-Object System.Uri($_.enclosure.url)
    $file = [Regex]::Replace($_.Title + " " + $url.Segments[-1] , $pattern, ' ')
    $file
    if (!(test-path $file))
    {
            (New-Object System.Net.WebClient).DownloadFile($url, $file)
    }
}

 

Just copy the code, paste it into a file called “Build2014.ps1”, create a directory (in my case “d:\Build14”) and change the path in the first line of the script.

Right click on the file and choose run with PowerShell.

 

In case you get a problem similar like “Build2014.ps1 cannot be loaded because running scripts is disabled on this system.”

Start PowerShell as an administrator and run “set-executionpolicy unrestricted”, this is probably a bad thing to do for security.


Using RC API on Windows 8.1

2014-01-12 23:09:00 +0000

This is a short blog post on how to get RC API working on your Windows 8.1 Device.

Setup

Download RCAPI from Nuget

image_thumb[1]

 

Bluetooth

To be able to communicate thru Bluetooth you need to edit Package.appxmanifest

Add the following lines:

<Capabilities>
    ....
    <m2:DeviceCapability Name="bluetooth.rfcomm">
      <m2:Device Id="any">
        <m2:Function Type="name:serialPort" />
      </m2:Device>
    </m2:DeviceCapability>
  </Capabilities>

 

 

Pair with the device

Go into settings (win + c, Settings) , Change PC Settings, PC and Devices, Bluetooth

  image

 

The Car

Instantiate the car and you are good to go, the car class connects to the correct Bluetooth device automagically.

Ferrari458Italia ferrari = new Ferrari458Italia();

To start sending commands to the car you need to call the ConnectAsync method and call the Start method.

await ferrari.ConnectAsync();
ferrari.Start();

 

Controlling steering and speed

There are two properties controlling speed and steering.

Steering is –1 to 1 (left to right) and speed –1 to 1 (backward to forward).

In the sample projects I have used the Virtual Joystick project available on Codeplex for speed and steering, there is a modified version in the Windows Store sample project.

 

Controlling the lights

The lights are exposed through properties, to turn the light on use:

ferrari.HeadLightOn = true;

The lights available on the Ferrari 458 Italia is Headlights,blinkers (left and right) and break.

To get the lights to blink it is possible to supply an array with a light enum so if you want the blinkers to blink left

ferrari.LightSequence = new byte[] { (byte)LightEnum.LeftBlinker, 0 };

To get a more fun blinking sequence you might want to try something like this

ferrari.LightSequence = new byte[] { (byte)LightEnum.Head, (byte)LightEnum.RightBlinker, (byte)LightEnum.Break, (byte)LightEnum.LeftBlinker };

 

Trimmer

Trimmer property makes it possible to adjust the wheel orientation 0 to 15 and 8 is straight forward.

Using RC API on Windows Phone

2014-01-12 01:51:00 +0000

This is a short blog post on how to get RC API working on your Windows Phone Device.

Setup

Download RCAPI from Nuget

image

 

Capabilities

To be able to communicate thru Bluetooth you need to enable ID_CAP_Proximity.

Open WMAppManifest.xml and make sure ID_CAP_Proximity is ticked.

  image

 

Pair with the device

Open Settings, Bluetooth and pair the phone with your device.

 

The Car

Instantiate the car and you are good to go, the car class connects to the correct Bluetooth device automagically.

Ferrari458Italia ferrari = new Ferrari458Italia();

To start sending commands to the car you need to call the ConnectAsync method and call the Start method.

await ferrari.ConnectAsync();
ferrari.Start();

 

Controlling steering and speed

There are two properties controlling speed and steering.

Steering is –1 to 1 (left to right) and speed –1 to 1 (backward to forward).

In the sample projects I have used the Virtual Joystick project available on Codeplex for speed and steering.

 

Controlling the lights

The lights are exposed through properties, to turn the light on use:

ferrari.HeadLightOn = true;

The lights available on the Ferrari 458 Italia is Headlights,blinkers (left and right) and break.

To get the lights to blink it is possible to supply an array with a light enum so if you want the blinkers to blink left

ferrari.LightSequence = new byte[] { (byte)LightEnum.LeftBlinker, 0 };

To get a more fun blinking sequence you might want to try something like this

ferrari.LightSequence = new byte[] { (byte)LightEnum.Head, (byte)LightEnum.RightBlinker, (byte)LightEnum.Break, (byte)LightEnum.LeftBlinker };

 

Trimmer

Trimmer property makes it possible to adjust the wheel orientation 0 to 15 and 8 is straight forward.

RC API now available

2014-01-12 01:08:00 +0000

Backstory

For Christmas 2 years ago my mother-in-law got me a Silverlit Bluetooth car.

Sadly it was a MFI device (Made for iPhone) and it seems to be more or less impossible to connect to an MFI-device without an iPhone (if someone has more info on this please let me know).

After talking to Silverlit, trying to convince them to share the protocol I got a Silverlit Ferrari 458 Italia (for android) and managed to figure out how the protocol worked.

RC API is an open source project on Codeplex which currently support controlling the Silverlit Ferrari 458 Italia from Windows 8.1 and Windows phone 8.

 

How to use

Windows 8.1

Windows phone

 

The future

I hope to be able to add more veichles and helicopters to the API, please let me know (or contribute) what you want me too add =D


If you are an RC device manufacturer and would like to include your device in the API, please let me know and I’ll make it happen.
Making the API I have used inspiration from the Lego EV3 codeplex project, I liked how they solved Bluetooth communication and I decided to do it basically the same way.

Source code for RC API is available on Codeplex and also available as a nuget package.

 

Let’s bring more gadgets and RC-stuff to the Windows platforms =D

2013

Developer Christmas list

2013-12-06 00:54:00 +0000

Here is my take on what is the most exciting products for the 2013 Christmas.
Some are available and some will be available early 2014, I mention these cause they are so awesome it could be worth the wait.
For those who know me, wait isn't what I do best so I feel your pain and I am sorry, I just had to include them.

 

Lumia 1520

6” Screen, 20 MP camera, enough said =)

http://www.nokia.com/global/products/phone/lumia1520/

 

Xbox One

If you live in a country that gets the Xbox One in the first batch, I guess it won't be on any Christmas list cause you already should have bought it :D
For those (like me) who live in a country that is not included in the first batch there might still be time to import one :)


Lego Mindstorms EV3

There is no age restrictions for Lego, this is a really awesome product.
It has motors, sensors and you can build almost anything.
The best part is that there is a .net library so you can build your own apps.

LEGO.com Mindstorms

http://legoev3.codeplex.com/

Raspberry Pi

A micro computer that runs Linux. It has everything you might need, Ethernet, hdmi, USB, audio and controllable pins you can use to connect to other things.
Since it runs on Linux, Mono can be used to develop for it.

http://www.raspberrypi.org/


Agent Smartwatch

A wristwatch capable of running .net Micro framework code (how awesome is that?), much like the S.P.O.T watch back in the day.
As far as I understand they won't ship until after Christmas bit there is an SDK already available so start coding :)

http://agentwatches.com/


.NET Gadgeteer

Speaking of .NET micro framework, this is a fast prototyping kit, that makes building basically any electronics really easy.
It has standardized connectors that means you don't have to know any electronics. It is really simple to get going.

https://www.ghielectronics.com/catalog/category/265


Myo

A gesture controlled arm and, you can control your electronics by using gestures.
Becoming a Jedi is no longer a dream.
I have no idea how the development environment looks like, still want one.

https://www.thalmic.com/en/myo/


Nymi

It can use unique cardiac rhythm to authenticate your identity, allowing you to wirelessly take control of your computer, your smartphone, your car and so much more.

http://www.getnymi.com/


Kinect 2 for Windows

The new Kinect is even more sensitive than the first generation, it can even read your heartbeat *mind blown*.
I think wearable tech is the next big thing, but lets face it, tech you don't even have to wear is even cooler.

http://www.microsoft.com/en-us/kinectforwindows/ (this is still the old one)

 

Leap Motion

All devices that makes it possible to control your computer is always fun.
The leap motion can track your fingers and also other objects like pens and such.

https://www.leapmotion.com/


Anki

This is a racing track that connects to your iOS device (iPhone/iPad) using Bluetooth, the cars will drive around that track themselves but you control speed, lane and weapons. Yes weapons.
Real cars and real track but software shields and weapons *bummer*.
All the logic is in the iOS app and you can "upgrade" the cars with shields and new weapons.
If you shoot a car it will derail.
Very cool stuff so if you have an iPhone or iPad this is probably the must by Christmas gift this year.

http://anki.com/

 

If you don't find anything on the list or if you have a husband or wife that share my love for not waiting (eg already have or have ordered most of this stuff) you might consider printing your own.


3D Printer

There are many 3D printer out there. I like the cube 2, it is small and so is (sadly) the printing size. But it is large enough, the alternatives (having a reeeeally large one) isn't that appealing.
If you have trouble convincing your wife about a 3D printer, show her that it is possible to print chocolate :P
Besides that, Windows 8.1 has build in support for 3D Printers.

http://cubify.com/

http://makerbot.com/

Building your own Lego Mindstorms EV3 Windows Phone app

2013-11-20 19:14:00 +0000

I just love gadgets, especially those I can develop for.

I recently got the Lego Mindstorms EV3-kit and of course I wanted to make a Windows Phone app to control it =D.
Here is a tutorial on how to make your own.

The basics

The EV3 has 2 different types of ports, motors and sensors.
Motor ports are A, B, C and D, Sensor ports are 1, 2, 3 and 4.

Check the firmware

To be able to use the API you need to have a firmware version >= 1.03, You can check the version on the brick from the Settings tab-> Brick Info –> Brick FW
To update the firmware run “LEGO MINDSTORMS EV3 Home Edition” and choose Tools –> Firmware Update

image

Enable Bluetooth

To be able to connect to the brick you need to enable Bluetooth you can do that on the brick from the Settings tab-> Bluetooth.
Enable Visibility and Bluetooth.

Pair with the brick

Pair your phone with the brick by going to Settings –> Bluetooth tap on “EV3”, the brick will now ask Ii f its ok to pair and then show a pin code.
Accept the default pin “1234” and enter it on the phone.

We are now all set up to start coding.

I have a Nokia Lumia 920 that I got from //Build, I can’t connect to the brick using that one, it might be a problem with all Lumia 920 developer phone (please let me know).
Luckily I also have a retail Lumia 920 and I have tested this code on a Lumia 1020, 720, 920 and HTC 8X and it works great (just not the //Build one).

Start a new project

image

 

Right click on references and click Manage Nuget packages

Search for "EV3”

image

Click install on “Lego Mindstorms EV3 API”


Enable Bluetooth by opening Properties/WMAppManifest.xml
Enable the capability ID_CAP_PROXIMITY

image

 

The API has the ability to connect to the EV3 by Wi-Fi, Bluetooth and USB for this project I will focus on Bluetooth only.

In MainPage.xaml
Create a button named “ConnectButton” and give it the text “Connect”
Create a button named “MotorAForwardButton” and give it the text “Motor A forward”
Create a button named “MotorStopButton” and give it the text “Stop”

Double click on each button to create the event handler in the code behind.

In MailPage.Xaml.cs att the following code:

private Brick brick;
private async void ConnectButton_Click(object sender, RoutedEventArgs e)
{
    brick = new Brick(new BluetoothCommunication(), true);
    await brick.ConnectAsync();
}

private void MotorAForwardButton_Click(object sender, RoutedEventArgs e)
{
    brick.DirectCommand.TurnMotorAtPowerAsync(OutputPort.A, 50);
}
        
private void StopStopButton_Click(object sender, RoutedEventArgs e)
{
    brick.DirectCommand.StopMotorAsync(OutputPort.All, false);
}

protected override void OnNavigatedFrom(NavigationEventArgs e)
{
    brick.Disconnect();
    base.OnNavigatedFrom(e);
}

 

I have kept this sample really simple so you can get a quick start.
You should always add error handling and you should disable the buttons unless you already connected and so on.
This is just to get you started.
I realize that this sample isn’t that exciting, but now we know how to control motors, time to kick things into gear and build some fun stuff =D

Related links

https://legoev3.codeplex.com/
The site for the EV3 API, with video instructions

http://www.lego.com/en-us/mindstorms/downloads/software/ddsoftwaredownload/download-software/
Download for LEGO MINDSTORMS EV3 Home Edition

Controlling a Bluetooth car with a Windows Phone

2013-11-13 21:58:00 +0000

Last Christmas my mother-in-law gave me a Bluetooth controlled car.
These kind of gifts are the best for a developer like me, its a toy/gadget and there is no app for Windows Phone which means I just got a gadget AND a development project.
I have been in contact with Silverlit (the company that manufacture the car) who sadly decided not to take my offer of developing their app/API for free, and also didn't supply me with any details regarding the protocol (I guess they where short of resources).

 

Challenge accepted.

 

After a couple of weeks I managed to figure out the protocol Open-mouthed smile.
Now I have an API for the car ready but I would like Silverlits permission to release it before I do so.
I am also working on making the API available for Windows 8.1.

 

</param></embed>
Me contorolling a Silverlit Ferrari 458 Italia with my Windows Phone

 

Currently Silverlit isn't returning my emails, not sure why (could be that the contacts I had doesn't work there anymore).
If you know a good contact at Silverlit please let me know, I really would like to release this API so that more developers will be able to develop for this BT car because it is really awesome.

ZX Spectrum emulator running “on” a Agent smartwatch

2013-07-31 23:26:00 +0000

Why you ask? Because it can be done… and therefore it should (?) Ler med tungan ute

Since the resolution on the ZX Spectrum is 256x192 pixels (not counting borders) and the resolution on the agent smartwatch is 128x128 pixels I had to make the screen smaller and as you can see from the image below, not really readable and as you might expect quite slow.
But the important part is: it works.

 

image

 

It only took me an evening to get this working, I really love the SDK and how well it works together with Visual Studio 2012.

This might be the best Christmas ever with both the Xbox One and Agent releasing around December, I can’t wait =)

 

If you haven’t seen the Agent Smartwatch, it is a smartwatch developed by Secret labs (the same guys who builds netduino) that runs .net Micro Framework.

Check it out here

2011

Our Kinect Controlled living room

2011-11-19 17:44:00 +0000

Recently I created a project for a Swedish Kinect contest at Migbi.se this was my second entry, my first one (and third place winner) was my Robosapien project.

I have always been fascinated by home automation, I bought my first X-10 system ten years ago.

My friends thought I was insane, “-You can just get up an shut the light off".

But that’s not the point, it’s not because I’m lazy it’s all about removing obstacles, what if when I enter a room the lights turns on, when I go to bed everything turns off.

Saves energy, saves time, removes obstacles.

 

Peter Forss made a really cool entry to the contest, his project turns on and off lights depending on where he is in the room.

This inspired me, I wanted to do something with Kinect and home automation.

 

I had previously built a home automation system that can control our home (lights, infrared devices etc) so the only thing I needed to do is hook up the Kinect.
I wanted to be able to control what lights to turn on just by pointing at them.

So here is my attempt to control our living room with a Kinect.

 

 
Kinected living room

 

How it works

I added all my light in an array with the lights X and Z position relative to the kinect sensor (in meters).

For each light, I calculate the angle from where I am in the room to the light and compare it to the angle between me (my body’s centre) and my hand.

 

Then I check for the light on gesture (hand under shoulder moved to over shoulder) or light off gesture (hand over shoulder moved to below shoulder).

 

These gestures sends a command to my home automation system to executes the correct command.

It uses a Tellstick to control the lights, the beauty of that device is that it can control close to any type of protocol (I use Nexa or in some cases the cheapest possible plug-in lamp module I could find, it also works with X10).

 

In this video I only control lights and screen, but it is possible to control infrared devices like tv or home cinema.

 

Please feel free to send me an email if you have any questions.

gadgeteer, first impressions

2011-10-17 00:00:00 +0000

Got my Gadgeteer compatible FEZ Spider kit a couple of days ago.

For those not familiar with Gadgeteer, it is an open source toolkit for building small electronic devices using .NET Micros Framework.
Microsoft is behind this project and GHI is the first manufacturer to release compatible hardware.

I have used Netduino before, the “problem” with Netduino is that it is extremely basic, you really need to know electronics.

Since I read a lot of these things in school I thought it would be a piece of cake getting stared with Netduino but reality soon came knocking.

Apparently nearly everything I learned in school about these things are gone, quite easy to read up on but still an obstacle between me and my new hardware toy Ler med tungan ute.


Gadgeteer is a fast prototyping kit that uses standard 10 pin sockets that are impossible to turn the wrong way.
It makes it really simple and removes obstacles between you and your finished prototype.
What I like about the Gadgeteer is that it has very little integrated functions, if you want Ethernet for example you need to connect the Ethernet module, there is not Ethernet built-in on the motherboard.

It has 14 connectors and every connector has a letter beside it.
The letter indicates what kind of module you can connect to that socket.

 

Installation

Its really simple to get started, GHI has an install-package that include everything you need to make your first application, or perhaps gadget is a more accurate description.

 

Start Coding

Now you are ready to start your first Gadgeteer project.

In Visual Studio you will find a new template section called Gadgeteer, to start making an app simply select “.NET Gadgeteer Application”.

What I saw next really made me happy, in Visual Studio you’ll get a designer window.

You only need to drag in the modules you wish to use and connect them to a compatible socket.

The designer even tells you which sockets that are ok.

But it doesn’t stop there!
Instead of connecting them manually you can right click and select “connect all modules” and the designer does the job for you.

These kind of help functions really makes me happy, I want to concentrate on coding not other things.

 

Some initial problems
I started of by adding a Multi color LED and wrote
led.TurnBlue();

And the LED did just that, it turned Green.. Say what now!?
Apparently there is a bug, in the LED’s firmware, but GHI is working on the problem.


Next I tried to make a camera app, press a button, take a picture and show it on the screen.

However the buttons didn’t trigger the pressed event this is also an known issue.

So the first two things I tried fail which actually made me a bit concerned.

GHI seems to be on top of things and is really active on their forums so I hope they will come up with a great solution.

Despite the initial problems I would say, buy this kit =)
There is a special feeling when you code runs on a device (like a phone for example).
There's an even more special feeling when your code runs on a device you just put together =)

Kinect + Robosapien = <3

2011-07-04 10:30:00 +0000

Seeing all the cool Kinect demos around I wanted to try out the SDK myself.
I love those demos that makes it possible to interact with real world things thru the Kinect so I decided to dust off one of my Robosapien (v1).

For those who don’t know Robosapien, it is a small robot made by WowWee, and it’s reasonably cheap.

To communicate with the Robosapien I need to use IR and I just happen to have a usbuirt so I borrowed it from the living room.

Next I needed to get all the commands that I can use with the Robosapien, I found a great list here.

Then it was time to dig into the Kinect SDK, I decided to only implement arm movement, walking seemed silly for this sample.

I also implemented some voice commands to test the voice recognition which worked great, a bit sensitive (sometimes the Robosapien triggered voice commands while making sounds).

I used one of the Kinect SDK samples as a base for my application to see what the camera captured.

 

This was a really fun project to work on, took me about a day to make, trying different things and learning how the joints work.

Check out my Kinect Extension methods here.

 

If you are interested in the source code please contact me and I’ll send you a copy.

 

 
Video of me controlling my Robosapien

 

Some resources

Kinect SDK Beta
http://research.microsoft.com/en-us/um/redmond/projects/kinectsdk/
http://research.microsoft.com/en-us/um/redmond/projects/kinectsdk/docs/Speech_Walkthrough.pdf

 

USB-UIRT
http://usbuirt.com/

 

Robosapien
http://www.wowwee.com/en/products/toys/robots/robotics/robosapiens/robosapien

KinectRobosapien.zip (310.63 kb)

Kinect Extensions

2011-07-03 02:12:00 +0000

The Kinect SDK doesn’t have any built-in gesture system, it is however quite easy to use joints and check how they relate to each other.

 

For example:
if  (data.Joints[JointID .HandRight].Position.Y >  data.Joints[JointID.ShoulderRight].Position.Y)

 

That would trigger if I hold my right hand over my right shoulder.
It is still a bit hard to read and I wanted to simplify both reading and writing the code to check different joints, so I created a couple of extension methods to help out.

 

Code that does the same as above would look like this using my extensions:
var
  joints=data.Joints;
if  (joints[JointID .HandRight].HigherThan(joints[JointID.ShoulderRight]))

 

So far I have implemented:

HigherThan
LowerThan

BetweenVertically
BetweenHorizontally
ToTheLeftOf
ToTheRightOf

 

Hope these extensions will help =)

 

JointExtensions.zip (436.00 bytes)

Connecting netduino to a lcd display

2011-02-11 18:44:00 +0000

image

 

When connecting your Netduino to a LCD display you won’t be able to du much more.

You’ll end up using almost all your connections, that really sucks.

Luckily there is a way to solve that by using a 8-bit shift register.

I found an article on how to connect it and decided to get mostly the same components (with a few exceptions since I don’t have a backlight on my LCD).

Just like my last post there is no real value in describing how to do this since Szymon did a great job in the above mentioned article.

Day 1 with Netduino

2011-02-07 23:34:00 +0000

 

image

 

My wife gave me a Netduino for my birthday, I don’t have any experience with .net micro framework so this is going to be a whole new thing for me.

I wanted to start of easy, so I dug up an old LCD display (bought ten of them a couple of years ago but never got around to use them).

Found Pete Browns blog post about how to hook up an LCD  display to a Netduino, luckily it was a HD44780-controlled just like the one Pete used in his blog post.

 

After installing all the necessary software I started to connect the display to the Netduino.

It took me about 30 min from start to “Hello World”.

I Just love how easy it is to work with.

 

My first thought was to make this blog post a tutorial on how to hook up a LCD to a Netduino but since Pete’s blog post was really great, no need to reinvent the wheel.

 

Some resources:
First Experiences with Netduino and the .NET Micro Framework
Using a 4x20 HD44780-controlled LCD Display with the Netduino
Netduino software download

2010

TFS Buddy

2010-06-06 15:29:00 +0000

Fick en I-Buddy av min fru för någon vecka sedan och hade precis i samma veva installerat TFS 2010.
Jag mindes Brian the bunny som är en fantastisk rolig implementation och beslöt mig för att göra en egen version för min I-Buddy.

Först så behöver jag kunna lyssna på events som Team Foundation Server (TFS) 2010 levererar.
Det finns en del guider som visar hur man gör men jag fick det inte riktigt att lira ändå, det har hänt lite grejer i API:et sedan 2005/2008, och de flesta guiderna jag hittade använde asmx.
Men tillslut så hittade jag ett fantastiskt bra kodexempel på hur man i kod sätter upp en WCF-tjänst för TFS här.
Jag ville hellre skapa WCF tjänsten i kod istället för att hämta inställningar från app.config för att användarna inte ska behöva tänka på alla inställningar som måste göras.

Kort om WCF Tjänsten
Första steget är att skapa en WCF-tjänst som har en metod som heter Notify.
Jag har valt att skapa en endpoint som hanterar alla olika typer av inkommande anrop istället för att göra som bl.a. Brian the bunny (och många andra) som har en endpoint för varje meddelandetyp.

Filter med Dynamic Linq
Jag ville att man skulle kunna få I-Buddyn att göra olika saker så fort den fick in notifieringen om att något ändrats men också att den skulle kunna tex blinka rött om ett bygge har misslyckats och grönt om det lyckats.
Har använt Dynamic Linq en del i andra projekt och kände att det är perfekt för att kunna få flexibla filter möjligheter.

 

 

Fördröjning
TFS 2010 har en 2 minuters väntetid mellan att saker händer tills dess att den skickar ut notifieringar och det kan ju givetvis vara vettigt i vissa fall men jag vill ju ha notifieringarna direkt och lyckligtvis finns det ett enkla sätt att ta bort väntetiden.

Via Power shell: Chris Sidi’s Blog
Via SQL script: Crispin Parker’s Blog

Lycka eller sorg?
När jag vaknade för några mornar sedan så ser jag att min i-buddy lyser rött, det är en rätt konstig känsla, kände mig fantastisk glad av att den lyste rött trots att det betydde att ett nattbygge har fallerat men bevisar att applikationen fungerar =).

Några bra resurser
TFS2010: Diagnosing Email and SOAP subscription failures

TFS Buddy finns att ladda hem på Codeplex
I-Buddy finns att köpa på Coolstuff, Kjell & Co, Pixmania

Olåda paket från Microsoft

2010-04-14 21:17:00 +0000

geekarc

Idag fick jag priset från Microsofts Geek Award där jag hamnade på tredje plats.
Priset var ett Microsoft Arc tangentbord och mus.
Riktigt riktigt nice tangentbord lätt att ta med och det medföljer en liten väska/påse som man kan ha tangentbordet i.
Både mus och tangentbord är trådlösa och mottagaren fästs med magnet när man inte använder dem under tangentbordet respektive mus.
Det var bara att plugga in mottagarna i datorn och köra, inga synkningar som man ibland behöver med andra trådlösa tangentbord.

Musen går att fälla ihop för att man lättare ska kunna ha den med sig till t.ex. laptoppen, det fina är att den stängs av när man fäller ihop den så den drar inget batteri i onödan.
Vårt trådlösa tangentbord till HTPC:n har strulat ett tag nu vilket gör dessa enheter ännu mer välkomna.
Jag hade hellre haft det till min stationära dator men eftersom jag har likadana tangentbord både på jobbet och hemma så skulle det innebära att jag “måste” köpa ett nytt till jobbet också och eftersom vår HTPC skulle behöva ett nytt tangentbord så kommer jag låta den sunda logiken tala och helt enkelt koppla in både mus och tangentbord i den.

Tack Microsoft för det fina vinsten.