octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: sendCommand


From: JohnD
Subject: RE: sendCommand
Date: Tue, 25 Aug 2020 14:27:03 -0400

> Message: 1
> Date: Mon, 24 Aug 2020 15:59:06 -0500 (CDT)
> From: Aline <aline_peres_leal@hotmail.com>
> To: octave-maintainers@gnu.org
> Subject: sendCommand
> Message-ID: <1598302746388-0.post@n4.nabble.com>
> Content-Type: text/plain; charset=us-ascii
> 
> I'm using arduino 0.5.0 with HX711 on Octave 4.2.2. But I'm havinfgproblems
> with the command "sendCommand":
> 
> error: 'sendCommand' undefined near line 52 column 21
> error: called from
>     read_HX711 at line 52 column 19
> 
> 
> 
> %***************************************************************
> ***********
> classdef aline_HX711 < arduinoio.LibraryBase
>     properties(Access = protected)
>         Pins %Data and Clock pin
>     endproperties
>     properties (Access = private, Constant = true)
>         READ_HX711 = hex2dec('01');
>     endproperties
>     properties(Access = protected, Constant = true)
>         LibraryName = 'basicHX711/aline_HX711'
>         DependentLibraries = {}
>         LibraryHeaderFiles = 'basicHX711/aline_HX711.h'
>         CppHeaderFile = fullfile(arduinoio.FilePath(mfilename('fullpath')),
> 'src', 'aline_HX711.h')
>         CppClassName = 'aline_HX711'
>     endproperties
> 
>     methods(Hidden, Access = public)
>         function obj = aline_HX711(parentObj,inputPins)
>             obj.Parent = parentObj;
>             obj.Pins = getTerminalsFromPins(obj.Parent,inputPins);
>             configurePin(parentObj,inputPins{1},'DigitalInput'); % Data Pin
>             configurePin(parentObj,inputPins{2},'DigitalOutput'); % Clock
> Pin
>         endfunction
>     endmethods
> 
>     methods(Access = public)
>         function force = read_HX711(obj)
>             cmdID = obj.READ_HX711;
>             inputs = obj.Pins;
>             value = sendCommand (obj, obj.LibraryName, cmdID, inputs);
>             value(3)=bitshift(value(3),16);
>             value(2)=bitshift(value(2),8);
>             force = bitor(value(3),bitor(value(2),value(1)));
>         endfunction
>     endmethods
> endclassdef
> 
> Can someone help me?
> 
> 
> 

In octave-arduino,

sendCommand expects the Arduino object - ie: obj.Parent:

value = sendCommand (obj.Parent, obj.LibraryName, cmdID, inputs);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]