Giter Club home page Giter Club logo

Comments (5)

tino avatar tino commented on August 20, 2024 1

Hmm, yeah processes will fight for CPU time. Get a bigger one ;).

Note that pyFirmata is great for prototyping and getting stuff working. If you some high performance or more stability, it often pays of to write some stuff that runs directly on the Pi (and thus is not affected by Chrome and the likes). The waveform function is easily ported to C++, and you can set it up as a sysex function. That way you can still call it from python, but it runs directly on the Pi.

Good luck!

from pyfirmata.

tino avatar tino commented on August 20, 2024

I am not completely sure what problem is. You seem to have it working when you don't put in a time.sleep() right?

Google Chrome being of influence on the sleep or execution time seems highly unlikely, unless it's eating all your CPU.

Also be aware that if you run this on Python 2, 1/1000 == 0.

from pyfirmata.

tanthua avatar tanthua commented on August 20, 2024

Thank you for the response. It does work fine without time.sleep(). I was able to reproduce the problem by putting the block of codes into a second thread, and it slowed down regardless of what is opened. Thinking of how to fix that now because my application needs to send data constantly and I don't want it to be interrupted by other apps. And it's more like python issue itself, not from the serial connection or so.
Again, thanks a lot man.

from pyfirmata.

tanthua avatar tanthua commented on August 20, 2024

I finally got it working. It's the OS system. Not pyfirmata :D

from pyfirmata.

tino avatar tino commented on August 20, 2024

Ah sweet!

from pyfirmata.

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.