Esempio n. 1
0
        static void Main()
        {
            M2k ctx = libm2k.m2kOpen();

            ctx.calibrateADC();

            // Setup analog in
            M2kAnalogIn ain = ctx.getAnalogIn();

            ain.enableChannel(0, true);

            double voltage = ain.getVoltage(ANALOG_IN_CHANNEL.ANALOG_IN_CHANNEL_1);

            Console.WriteLine(voltage);
            libm2k.contextClose(ctx);
        }
Esempio n. 2
0
        static void Main()
        {
            M2k ctx = libm2k.m2kOpen();

            ctx.calibrateADC();

            // Will turn on the power supply if we need smth to measure
            M2kPowerSupply ps = ctx.getPowerSupply();

            ps.enableChannel(0, true);
            ps.pushChannel(0, 1.7);

            // Setup analog in
            M2kAnalogIn ain = ctx.getAnalogIn();

            ain.enableChannel(0, true);

            double voltage = ain.getVoltage(ANALOG_IN_CHANNEL.ANALOG_IN_CHANNEL_1);

            Console.WriteLine(voltage);
            libm2k.contextClose(ctx);
        }