using latest freshly downloaded NETMF SDK for VS2013 and latest GHI stuff
using this snippet:
https://www.ghielectronics.com/community/codeshare/entry/939
using System;
using Microsoft.SPOT;
using GHI.Usb.Host;
using GHI.Usb.Descriptors;
using System.Threading;
namespace ControllerTest
{
public class Program
{
static XBox360Controller gamepad;
public static void Main()
{
Debug.Print(Resources.GetString(Resources.StringResources.String1));
Controller.UnknownDeviceConnected += Controller_UnknownDeviceConnected;
Controller.Start();
Thread.Sleep(-1);
}
static void Controller_UnknownDeviceConnected(object sender, Controller.UnknownDeviceConnectedEventArgs e)
{
Debug.Print("Somethin connected");
Debug.Print(e.Id + " " + e.VendorId + " " + e.ProductId + " " + e.PortNumber);
if (e.VendorId == XBox360Controller.VENDOR_ID && e.ProductId == XBox360Controller.PRODUCT_ID)
{
gamepad = new XBox360Controller(e);
ThreadStart s = new ThreadStart(GamepadLoop);
Thread t = new Thread(s);
t.Start();
}
}
static void GamepadLoop()
{
while (gamepad.Connected)
{
//gamepad.SetRumbleIntensity(gamepad.GetTriggerPosition(XBox360Controller.Trigger.Left), gamepad.GetTriggerPosition(XBox360Controller.Trigger.Right));
Debug.Print(gamepad.GetTriggerPosition(XBox360Controller.Trigger.Left).ToString());
Thread.Sleep(100);
}
}
}
}
throws repeated
A first chance exception of type 'System.Exception' occurred in GHI.Usb.dll
0
0
Input Error: 2
0
A first chance exception of type 'System.Exception' occurred in GHI.Usb.dll
0
Input Error: 2
0
A first chance exception of type 'System.Exception' occurred in GHI.Usb.dll
0
0
Input Error: 2