public void Configure(OutputDataRate odr, DataRange range)
        {
            dataSettings[2] |= (byte)((byte)odr << 3);
            dataSettings[0] |= (byte)range;

            bridge.sendCommand(ACCELEROMETER, DATA_CONFIG, dataSettings);
        }
Ejemplo n.º 2
0
        public void Configure(OutputDataRate odr = OutputDataRate._100Hz, DataRange range = DataRange._125dps, FilterMode filter = FilterMode.Normal)
        {
            gyrDataConfig[1] &= 0xf8;
            gyrDataConfig[1] |= (byte)range;
            gyrDataConfig[0]  = (byte)((int)odr + 6 | (int)filter << 4);

            bridge.sendCommand(GYRO, CONFIG, gyrDataConfig);
        }
Ejemplo n.º 3
0
        public void Configure(OutputDataRate odr = OutputDataRate._100Hz, DataRange range = DataRange._2g, FilterMode filter = FilterMode.Normal)
        {
            accDataConfig[0]  = (byte)(((int)odr + 1) | ((FREQUENCIES[(int)odr] < 12.5f) ? 0x80 : (int)filter << 4));
            accDataConfig[1] &= 0xf0;
            accDataConfig[1] |= RANGE_BIT_MASKS[(int)range];

            bridge.sendCommand(ACCELEROMETER, DATA_CONFIG, accDataConfig);
        }
Ejemplo n.º 4
0
 public void Configure(ushort xyReps = 9, ushort zReps = 15, OutputDataRate odr = OutputDataRate._10Hz)
 {
     if (bridge.lookupModuleInfo(MAGNETOMETER).revision >= SUSPEND_REVISION)
     {
         Stop();
     }
     bridge.sendCommand(new byte[] { (byte)MAGNETOMETER, DATA_REPETITIONS, (byte)((xyReps - 1) / 2), (byte)(zReps - 1) });
     bridge.sendCommand(new byte[] { (byte)MAGNETOMETER, DATA_RATE, (byte)odr });
 }
        public void Configure(OutputDataRate odr = OutputDataRate._125Hz, DataRange range = DataRange._2g)
        {
            accDataConfig[0] &= 0xe0;
            accDataConfig[0] |= (byte)(odr + 8);

            accDataConfig[1] &= 0xf0;
            accDataConfig[1] |= RANGE_BIT_MASKS[(int)range];

            bridge.sendCommand(ACCELEROMETER, DATA_CONFIG, accDataConfig);
        }
Ejemplo n.º 6
0
        public void Configure(OutputDataRate odr = OutputDataRate._100Hz, DataRange range = DataRange._125dps)
        {
            gyrDataConfig[1] &= 0xf8;
            gyrDataConfig[1] |= (byte)range;

            gyrDataConfig[0] &= 0xf0;
            gyrDataConfig[0] |= (byte)(odr + 6);

            bridge.sendCommand(GYRO, CONFIG, gyrDataConfig);
        }
        public static byte[] Configure(Module module = ACCELEROMETER, OutputDataRate odr = OutputDataRate._100Hz, DataRange range = DataRange._2g, FilterMode filter = FilterMode.Normal)
        {
            accDataConfig[0] &= 0xf0;
            accDataConfig[0] |= (byte)(((int)odr + 1) | ((FREQUENCIES[(int)odr] < 12.5f) ? 0x80 : (int)filter << 4));
            accDataConfig[1] &= 0xf0;
            accDataConfig[1] |= RANGE_BIT_MASKS[(int)range];

            Scale = DataScale;

            return(sendCommand(module, DATA_CONFIG, accDataConfig));
        }
Ejemplo n.º 8
0
        public void Configure(OutputDataRate odr, DataRange range)
        {
            accDataConfig[0] &= 0xf0;
            accDataConfig[0] |= (byte)(odr + 1);

            accDataConfig[0] &= 0xf;
            accDataConfig[0] |= (byte)((FREQUENCIES[(int)odr] < 12.5f) ? 0x80 : 0x20);

            accDataConfig[1] &= 0xf0;
            accDataConfig[1] |= RANGE_BIT_MASKS[(int)range];

            bridge.sendCommand(ACCELEROMETER, DATA_CONFIG, accDataConfig);
        }
Ejemplo n.º 9
0
        public void Configure(OutputDataRate odr      = OutputDataRate._100Hz, DataRange range = DataRange._2g, float?highPassCutoff = null,
                              Oversampling oversample = Oversampling.Normal)
        {
            for (int i = 0; i < dataSettings.Length; i++)
            {
                dataSettings[i] = 0;
            }

            dataSettings[3] |= (byte)oversample;
            dataSettings[2] |= (byte)((byte)odr << 3);
            dataSettings[0] |= (byte)range;

            if (highPassCutoff != null)
            {
                dataSettings[1] |= (byte)(Util.ClosestIndex_float(OS_CUTOFF_FREQS[(int)oversample][(int)odr], highPassCutoff.Value) & 0x3);
                dataSettings[0] |= 0x10;
            }

            bridge.sendCommand(ACCELEROMETER, DATA_CONFIG, dataSettings);
        }
 public static extern void SetOutputDataRate(IntPtr board, OutputDataRate odr);
Ejemplo n.º 11
0
 public static extern void SetOutputDataRate(IntPtr config, OutputDataRate odr);
Ejemplo n.º 12
0
 public static extern void SetOutputDataRate(IntPtr config, OutputDataRate odr);
Ejemplo n.º 13
0
 public TestHighPassFilter(OutputDataRate odr) : base()
 {
     this.odr = odr;
 }