![]() Task.SetResult(new SpheroControl((Sphero)cxnRobot)) Provider.DiscoveredRobotEvent -= handler Var provider = RobotProvider.GetSharedProvider() TaskCompletionSource task = new TaskCompletionSource() Static Task InternalGetFirstConnectedSpheroAsync() Task task = InternalGetFirstConnectedSpheroAsync() Public static IAsyncOperation GetFirstConnectedSpheroAsync() The starting point for that is then to make a new project in Visual Studio of type “Windows Runtime Component”Īnd then add a reference to that Robotkit.dll that I got from the Sphero github project Īnd then I just wrote a little class called SpheroControl which offered up some of the functionality that’s within that Robotkit library in as simple, short a way as I could NET so I need to wrap something around it to turn it into a WinRT component that can be used from JavaScript. The demo that I showed was written in JavaScript so I’ll try and produce a minimalistic version of that here. You’ll also find some other bits and pieces that you might also find useful in the sample there. You can download that by going up to the official Sphero developer centre Īnd then finding your way across to this github project Īnd in there you’ll find Robotkit.dll which is a. There’s possibly another or a better way of doing this but it’s the direction that I took. ![]() You’re also going to need the Kinect for Windows V2 SDK so go and download that and install it – linked from the picture below ![]() The chances are that if the Sphero app in the Windows Store doesn’t work for you then your own code isn’t likely to so go grab that app by clicking on the image below Īnd give that a quick try. I didn’t really have any challenges in getting that done – I think it stumbled a bit on the first attempt but worked 2nd time around for me and has stayed working since. Once you’ve got your Sphero charged up and have it switched on ( double-tap ) you need to pair it up with Windows so you go to your bluetooth device settings Īnd pair it up. The best plan to go get bits is probably to follow the “Get Set Up” link below This is most likely going to be a PC but I suspect it can also be a Mac whether running Windows virtualised or dual-booted but I should say that I haven’t tried working with Kinect and Sphero on anything other than my Dell XPS 13. You’re going to need somewhere to run Visual Studio 2013 on Windows 8.1. Step 3 – Get a Dev Environment for Windows 8.1 Apps Set Up I’m not 100% sure whether other stores are available on this one. I’ve hyperlinked to the UK Microsoft Store from the image below He’s not likely to be able to get you one so I think you’d need to buy one. You’re also going to be needing a Kinect for Windows V2 sensor. Step 2 – Beg, Borrow, Buy a Kinect for Windows V2 I got mine from Amazon and I’ve linked the image below to them. I had a few people asking me how that was put together and so I thought I’d blog that here in the manner of a “Recipe” where I’ll try and keep the code/HTML as short as possible to reproduce what I showed at the recent “Native Summit” event. I wanted to knock up a quick demo for a talk about Windows 8.1 apps and I wanted to show that it’s possible to connect to interesting bits of kit from an app and the 2 of the “interesting” bits of kit that I came up with where Īnd I tied them together with some JavaScript code such that I could control the rotation of a Sphero device with my left hand by moving it away from my body and such that I could drive the sphero with my right hand by “pushing” it away from my shoulder. This post is really under the category of “hacking for fun”.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |