Example #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Headset Information Logger Example");

            EmoEngine engine = EmoEngine.Instance;                        

            engine.UserAdded += new EmoEngine.UserAddedEventHandler(engine_UserAdded_Event);
            engine.EmoStateUpdated += new EmoEngine.EmoStateUpdatedEventHandler(engine_EmoStateUpdated);

            // connect to Emoengine.            
            engine.Connect();

            HeadsetInformationLogger p = new HeadsetInformationLogger();

            string header = "Time, Wireless Strength, Battery Level, AF3, T7, Pz, T8, AF4";
            file.WriteLine(header);
            file.WriteLine("");

            while (true)
            {
                if (Console.KeyAvailable)
                    break;

                engine.ProcessEvents();

                // If the user has not yet connected, do not proceed
                if ((int)userID == -1)
                    continue;

                Thread.Sleep(10);
            }

            file.Close();
            engine.Disconnect();
        }
        static void Main(string[] args)
        {
            Console.WriteLine("Headset Information Logger Example");

            EmoEngine engine = EmoEngine.Instance;

            engine.UserAdded       += new EmoEngine.UserAddedEventHandler(engine_UserAdded_Event);
            engine.EmoStateUpdated += new EmoEngine.EmoStateUpdatedEventHandler(engine_EmoStateUpdated);

            // connect to Emoengine.
            engine.Connect();

            HeadsetInformationLogger p = new HeadsetInformationLogger();

            string header = "Time, Wireless Strength, Battery Level, AF3, T7, Pz, T8, AF4";

            file.WriteLine(header);
            file.WriteLine("");

            while (true)
            {
                if (Console.KeyAvailable)
                {
                    break;
                }

                engine.ProcessEvents();

                // If the user has not yet connected, do not proceed
                if ((int)userID == -1)
                {
                    continue;
                }

                Thread.Sleep(10);
            }

            file.Close();
            engine.Disconnect();
        }