Code Monkey home page Code Monkey logo

npm-nau7802's People

Contributors

maripo avatar

Stargazers

 avatar

Watchers

 avatar  avatar

npm-nau7802's Issues

selectChannel1() and selectChannel2() methods generate runtime error

Please note that pasting the proposed demo code in a new empty file named nau7802_reader.js and calling it with

generates the following runtime errors:

<
/home/pi/node_modules/nau7802/index.js:130
calibrate();
^

ReferenceError: calibrate is not defined
at ADC_NAU7802.selectChannel1 (/home/pi/node_modules/nau7802/index.js:130:5)
at Object. (/home/pi/nau7802_reader.js:5:5)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

I'm totally new to node.js, but I can guess that this depends from missing <this.> in front of calibrate method calls in selectChannelx() methods (lines 130 and 135); adding the <this.> modifier in front of these calls solves the error, but returned values seem to be not valid. Infact I only obtain alternating 256, 512, 0, -256 and -512 values, even if the load cell is progressively loaded.

How to use?

Hello,

I did installed npm on my raspberry.
I did installed nau7802

How should I run it ?

I do have the NAU7802 board attached to the raspberry over i²c.

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.