using System;
using Microsoft.SPOT;

using Microsoft.VisualStudio.TestTools.UnitTesting;
using CPF;

using System.Text;
using System.Threading;
using HWModules;
using SensorModules;
using SWModules;

namespace CPFUnitTests
{
    class OptodeUnitTests
    {
        [TestMethod]
        public void TestOptode()
        {
            HWModules.MotherBoard motherboard = HWModules.MotherBoard.Instance;

            Optode1 optode1 = Optode1.Instance;

            MessageQueue messageQ = MessageQueue.Instance;

            optode1.powerUp();
            messageQ.processQ(99);

            optode1.init();
            Thread.Sleep(500);
            //optode1.wakeUp();
            //Thread.Sleep(500);
            optode1.getAll();
            messageQ.processQ(99);
            Thread.Sleep(2000);

            for (int i = 0; i < 5; i++)
            {
                optode1.doSample();

                for (int j = 0; j < 10; j++)
                {
                    messageQ.processQ();
                    Thread.Sleep(100);
                }
            }
        }
    }
}