資源簡介
matlab開發-HX711的自定義數據庫。從HX711稱重傳感器放大器獲取數據并導入Matlab工作區。
代碼片段和文件信息
%?Copyright?2018?Nicholas?Giacoboni
%
%?Redistribution?and?use?in?source?and?binary?forms?with?or?without
%?modification?are?permitted?provided?that?the?following?conditions?are?met:
%
%?1.?Redistributions?of?source?code?must?retain?the?above?copyright
%????notice?this?list?of?conditions?and?the?following?disclaimer.
%
%?2.?Redistributions?in?binary?form?must?reproduce?the?above?copyright
%????notice?this?list?of?conditions?and?the?following?disclaimer?in?the
%????documentation?and/or?other?materials?provided?with?the?distribution.
%
%?THIS?SOFTWARE?IS?PROVIDED?BY?THE?COPYRIGHT?HOLDERS?AND?CONTRIBUTORS?“AS?IS“
%?AND?ANY?EXPRESS?OR?IMPLIED?WARRANTIES?INCLUDING?BUT?NOT?LIMITED?TO?THE?IMPLIED
%?WARRANTIES?OF?MERCHANTABILITY?AND?FITNESS?FOR?A?PARTICULAR?PURPOSE?ARE?DISCLAIMED.
%?IN?NO?EVENT?SHALL?THE?COPYRIGHT?HOLDER?OR?CONTRIBUTORS?BE?LIABLE?FOR?ANY?DIRECT
%?INDIRECT?INCIDENTAL?SPECIAL?EXEMPLARY?OR?CONSEQUENTIAL?DAMAGES?(INCLUDING?BUT
%?NOT?LIMITED?TO?PROCUREMENT?OF?SUBSTITUTE?GOODS?OR?SERVICES;?LOSS?OF?USE?DATA?OR
%?PROFITS;?OR?BUSINESS?INTERRUPTION)?HOWEVER?CAUSED?AND?ON?ANY?THEORY?OF?LIABILITY
%?WHETHER?IN?CONTRACT?STRICT?LIABILITY?OR?TORT?(INCLUDING?NEGLIGENCE?OR?OTHERWISE)
%?ARISING?IN?ANY?WAY?OUT?OF?THE?USE?OF?THIS?SOFTWARE?EVEN?IF?ADVISED?OF?THE?POSSIBILITY
%?OF?SUCH?DAMAGE.
%**************************************************************************
%%?CALIBRATE?YOUR?LOADCELL?WITH?ARDUINO
classdef?calibration?
????properties
????????n??????????????????%?Number?of?readings
????????known_weight???????%?Weight?used?for?calibration
????????tare_weight?=?0
????????scale_factor?=?1
????end???
????methods(Access?=?public)
????????%%?CONSTRUCTOR
????????function?cal?=?calibration(varargin)
????????????if?nargin?2
????????????????error(‘Not?enough?input?arguments.‘);
????????????elseif?nargin?>?2
????????????????error(‘Not?enough?input?arguments.‘);
????????????end?
????????????%?The?number?of?readings?must?be?positive
????????????if?varargin{1}?0
????????????????error(‘The?number?of?readings?must?be?positive‘);
????????????end
????????????cal.n?=?varargin{1};
????????????cal.known_weight?=?varargin{2};
????????end???????
????????%%?Tare
????????function?tare_value?=?tare(varargin)
????????????if?nargin?2
????????????????error(‘MyComponent:incorrectType‘...
????????????????????‘Not?enough?input?arguments:\nprovide?*calibration*?and?*HX711*?%s‘...
????????????????????????‘class?objects?in?this?order.‘);
????????????elseif?nargin?>?2
????????????????error(‘MyComponent:incorrectType‘...
????????????????????‘Too?many?input?arguments:\nprovide?*calibration*?and?*HX711*?%s‘...
????????????????????????‘class?objects?in?this?order.‘);
????????????end
????????????obj?=?varargin{1};
????????????HX711_obj?=?varargin{2};
????????????value?=?1:1:obj.n;
????????????for?i=1:1:obj.n
????????????????value(i)?=?read_HX711(HX711_obj);
????????????end
????????????tare_value?=?me
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????2667??2018-04-04?04:48??HX711?v2.0\+arduinoioaddons\+ExampleAddon\HX711.m
?????文件????????2382??2018-03-27?04:55??HX711?v2.0\+arduinoioaddons\+ExampleAddon\src\HX711.h
?????文件????????7599??2018-04-15?23:14??HX711?v2.0\calibration.m
?????文件??????111589??2018-01-02?06:53??HX711?v2.0\HX711.jpg
?????文件??????151060??2018-04-15?18:59??HX711?v2.0\HX711.mlapp
?????文件?????1787450??2018-04-18?05:20??HX711?v2.0\User‘s?Manual.pdf
?????文件????????1318??2018-04-17?18:01??license.txt
評論
共有 條評論