Giter Club home page Giter Club logo

Comments (2)

fivdi avatar fivdi commented on June 15, 2024 1

device.transfer(message, cb) works fine for me. The stress test tmp.js calls device.transfer(message, cb) successfully over 500 times a second to determine the temperature using a TMP36 analog temperature sensor wired to an MCP3008 SPI A/D converter on a Raspberry Pi 2.

Here is an example of the output from tmp36.js:

pi@raspberrypi:~/test/node_modules/spi-device/test/stress $ time node tmp36
606 606 223 21.935483870967744
556 1162 223 21.935483870967744
581 1743 223 21.935483870967744
585 2328 223 21.935483870967744
585 2913 223 21.935483870967744
582 3495 223 21.935483870967744
583 4078 223 21.935483870967744
592 4670 223 21.935483870967744
592 5262 223 21.935483870967744
590 5852 223 21.935483870967744
585 6437 223 21.935483870967744
595 7032 223 21.935483870967744
599 7631 223 21.935483870967744
584 8215 223 21.935483870967744
587 8802 223 21.935483870967744
588 9390 223 21.935483870967744
588 9978 223 21.935483870967744
586 10564 223 21.935483870967744
^C

real	0m19.077s
user	0m2.968s
sys	0m2.102s

I would suggest carefully studying the datasheet of the SPI device that you wish to use to confirm that it is being used correctly.

from spi-device.

DenyaS avatar DenyaS commented on June 15, 2024

Thank you very much for your quick response!
When cs1 is manually controlled, the second poll passes without errors.
I'm still researching the problem. I'm using a custom cs1 overlay.
My board nanoPi Neo.
Thanks for your hard work.

from spi-device.

Related Issues (20)

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.