static public void Disable()
 {
     if (i2cbus != null && i2cdev != null)
     {
         WriteToRegister(0x2A, 0);//bit 0 is 0 - standby
         isActived = false;
         i2cdev = null;
         i2cbus.Dispose();
         i2cbus = null;
     }
     
     
 }
		/// <summary>
		/// Disables the accelerometer to save power.
		/// </summary>
        public static void Disable()
		{
			if (!Accelerometer.IsEnabled)
				return;

            Accelerometer.WriteToRegister(0x2A, 0);

			Accelerometer.I2CDevice = null;
			Accelerometer.I2CBus.Dispose();
			Accelerometer.I2CBus = null;

			Accelerometer.Enabled = false;
        }
		/// <summary>
		/// Enables the accelerometer functionality if it was disabled.
		/// </summary>
        public static void Enable()
		{
			if (Accelerometer.IsEnabled)
				return;

			Accelerometer.I2CBus = new SoftwareI2CBus(Accelerometer.I2C_CLK, Accelerometer.I2C_DATA);
			Accelerometer.I2CDevice = Accelerometer.I2CBus.CreateI2CDevice(Accelerometer.I2C_ADDRESS, 400);
           
            //bit 0 is 1 - active
            //bit 0 is 0 - standby
            //bit 1 = 1: 8 bit accurate - fast mode read
            //bit 1 = 0: 10 bit accurate - normal mode read
            
            WriteToRegister(0x2A, 1);

			Accelerometer.Enabled = true;
        }
        //const String TEXT_EXCEPTION_00 = "Accelerometer needs to be enable by calling Enable() function";
        static public void Enable()
        {


            if (i2cbus == null)
            {
                i2cbus = new SoftwareI2CBus(i2c_clk, i2c_dat);
            }
            if (i2cdev == null)
            {
                i2cdev = i2cbus.CreateI2CDevice(0x1C, 400);
            }
               
           
           
            //bit 0 is 1 - active
            //bit 0 is 0 - standby
            //bit 1 = 1: 8 bit accurate - fast mode read
            //bit 1 = 0: 10 bit accurate - normal mode read
            
            isActived = true;
            WriteToRegister(0x2A, 1); //bit 0 is 1 - active
            
        }