octave-maintainers
[Top][All Lists]
Advanced

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

sendCommand


From: Aline
Subject: sendCommand
Date: Mon, 24 Aug 2020 15:59:06 -0500 (CDT)

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?



--
Sent from: https://octave.1599824.n4.nabble.com/Octave-Maintainers-f1638794.html



reply via email to

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