NeuroskyからMindsetのWindows 7 Sensor API対応ドライバーが公開されました
おばかアプリコンテストのセンサー部門で貸出が予定されているNeuroskyさんの脳波センサーMindsetのWindows 7 Sensor API向けデバイスドライバーが公開されました。
https://neurosky.jp/thinkgearsensor.html
すでにMindsetを購入されていて、Windows 7をお持ちの方は、是非チャレンジしてみてくださいね。
ただ、残念なことに、現段階では、脳波センサーはSensor & Location Platformに定義がありません。以下にCodepackを通じて脳波センサーを使うためのサンプルを紹介しますので、それを参考にアプリ開発を試みてください。
SensorList<Sensor> sensors = SensorManager.GetAllSensors();Sensor bwSensor = null; foreach (var sensor in sensors) { if (sensor.FriendlyName.CompareTo("Brainwave Sensor")==0){ bwSensor = sensor; break; }}if (bwSensor!=null){ Guid valueKey = new Guid("{f3ad07f4-1a88-4970-956a-68fc93b25729}"); bwSensor.TryUpdateData(); SensorReport dataReport = bwSensor.DataReport; // Poor Signalは0~200の値をとります。 // この値が0にならないと集中度、リラックス度は計測できません UInt32 poorSignal = (UInt32)dataReport.Values[valueKey][0]; // 集中度です。0~100。単位は% double attention = (double)dataReport.Values[valueKey][1]; // リラックス度です。0~100。単位は% double meditation = (double)dataReport.Values[valueKey][2]; // 以下は、Neuroskyさんから公開されているMindSetのSDKを見てね Int32 rawData = (UInt32)dataReport.Values[valueKey][3]; UInt32 delta = (UInt32)dataReport.Values[valueKey][4]; UInt32 theta = (UInt32)dataReport.Values[valueKey][5]; UInt32 alpha1 = (UInt32)dataReport.Values[valueKey][6]; UInt32 alpha2 = (UInt32)dataReport.Values[valueKey][7]; UInt32 beta1 = (UInt32)dataReport.Values[valueKey][8]; UInt32 beta2 = (UInt32)dataReport.Values[valueKey][9]; UInt32 gamma1 = (UInt32)dataReport.Values[valueKey][10]; UInt32 gamma2 = (UInt32)dataReport.Values[valueKey][11];}
|
Mindsetは、非同期ではデータが上がってこないので、DispatherTimer等を使って、定期的にデータを取得する必要があるので、ご注意。
では、コンテストに参加する方、超絶面白いアプリを期待してますので、がんばって~ね~。