user-1: Hi I am using an Arduino Mega 2560 with two sparkfun zx gesture sensors, two servos, 4 rgb leds strips and 4 light switches.
With the sensor, the code relies on interrupts, which interfere with the bahaviour of the servo and leds.
My knowledge of coding is limited so I am unsure of how to work around this, I think I have to introduce some new code.
interrupts leds and servos
However, I am unsure of how to introduce it.
Any help would be appreciated.

user27817: Driving servos and LEDs from a hardware PWM may help. They will maintain a steady state even if there are interrupts. They may be a little less responsive to changes if there are interrupts.
Are you doing too much when the sensor interrupts? Typically a sensor makes multiple measurements and may be filters the results. When it is ready it interrupts. In the interrupt it should do as little as possible. Typically sending a message via global to a polling function that is not running in an interrupt. For example it may set a flag and the poling function reads the result. Reading the result in the interrupt would be bad.

-1: <p>Hi I am using an Arduino Mega 2560 with two sparkfun zx gesture sensors, two servos, 4 rgb leds strips and 4 light switches.</p>

<p>With the sensor, the code relies on interrupts, which interfere with the bahaviour of the servo and leds.</p>

<p>My knowledge of coding is limited so I am unsure of how to work around this, I think I have to introduce some new code.
<a href="https://learn.adafruit.com/neopixels-and-servos/overview" rel="nofollow">interrupts leds and servos</a>
However, I am unsure of how to introduce it.</p>

<p>Any help would be appreciated.</p>
 27817: <p>Driving servos and LEDs from a hardware PWM may help. They will maintain a steady state even if there are interrupts. They may be a little less responsive to changes if there are interrupts.</p>

<p>Are you doing too much when the sensor interrupts? Typically a sensor makes multiple measurements and may be filters the results. When it is ready it interrupts. In the interrupt it should do as little as possible. Typically sending a message via global to a polling function that is not running in an interrupt. For example it may set a flag and the poling function reads the result. Reading the result in the interrupt would be bad.</p>
