Code covered by the BSD License  

Highlights from
PicoScope® 3000 Series - MATLAB® Generic Instrument Driver

image thumbnail

PicoScope® 3000 Series - MATLAB® Generic Instrument Driver

by

 

07 Nov 2012 (Updated )

MATLAB Instrument Driver for use with PicoScope 3000A/B oscilloscopes

adc2mv(scaleVoltages, raw, voltageRange, maxValue)
function [ mvValue ] = adc2mv(scaleVoltages, raw, voltageRange, maxValue)
%adc2mv(scaleVoltages, raw, voltageRange, maxValue) - Converts raw ADC value to millivolts
%   This function takes the following arguments:
%       scaleVoltage - set to 1 to convert, 0 to leave as ADC counts
%       raw - the raw ADC value
%       voltageRange - the voltage range used for the channel
%       maxValue - the maximum ADC value for the device

    if scaleVoltages == 1

            mvValue = (double(raw) * voltageRange) / maxValue ;

        else

            mvValue = raw;
    end
    
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Filename:    adc2mv.m
%
% Copyright:   Pico Technology Limited 2012
%
% Author:      HSM
%
% Description:
%   This is a MATLAB script that converts ADC counts to milliVolt values.
%
%	Ensure that the location of this file is in your MATLAB Path.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Contact us