YukMingLaw / ArduinoJoystickWithFFBLibrary

An Arduino Joystick Library With Force Feedback Feature
GNU Lesser General Public License v3.0
216 stars 56 forks source link

Game lagging because of FFB aka. why no to use delay() #40

Closed Reds-Blood closed 2 years ago

Reds-Blood commented 2 years ago

Accured in ACC: Game lagging and showing CPU usage >99%, even tho it hardly using the CPU. Got fixed by removing delay() in the code. So apperntly games need to get confirmation of the FFB data being read, which means the Arduino need to receive the data as often as possible. If you have code that would need delay(), put them in a function and use millis() or micros() to run them.