shokai / arduino_firmata

Arduino Firmata protocol implementation on Ruby
http://shokai.github.io/arduino_firmata
MIT License
104 stars 23 forks source link

Performance and annoying sound #32

Open threez opened 10 years ago

threez commented 10 years ago

Im using your library with the nonblocking turned on and eventmachine. I faced a problem with this part of the process input interval:

      @process_input_interval = eventmachine ? 0.0001 : 0.01

Since the interval in a eventmachine setup is very high my machine (linux) produces an annoying high freq. sound. Also it uses one core at 80% cpu (without doing anything). I manually tried this:

      @process_input_interval = 0.01

And it removed the sound and made the process use 2% cpu, when nothing happens.

Im not sure why the value is set the way it is currently. So maybe you can tell.

Thx & Kind regards