'Camera LED blinking with frequencies > 200 Hz [Visible Light Communication]

I'm currently working on a Visible Light Communication project and need some help to programm a fast blinking (>200Hz) LED Flashlight. My device is a HUAWEI CUN-L21 with firmware B115 and it is also rooted.

I already programmed an app using Android SDK that turns the Flashlight on and off with a specific delay using Thread.sleep(delay). The problem is, that even if I set the delay to just a few milliseconds, the max. frequency I get is around 35Hz which is too low.

I also tried to blink it fast via the timer trigger in shell. But the frequency was to low as well.

So here is my question: Is there any other way to get the LED to blink in a frequency of 200 Hz? Do I have to modify the LED driver in the kernelspace? And if so, how can I do that?



Solution 1:[1]

I managed to blink the LED via the timer trigger in shell with delay_on = 1ms and delay_off = 1 ms. So the frequency theoretically had to be 500 Hz. But somehow the LED doesn't blink constant. In the picture below, one can see, that after 10ms the LED stops to blink. To me it looks like some kind of PWM.

Measurement of the blinking frequency

So the LED is able to blink with a delay_on = delay_off = 1ms. But is there a way to get the LED of this smartphone to blink in this frequency for a longer period? Why does it stop after 10ms. Is there some kind of restriction, that is deeper than the LED driver in kernelspace?

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 flash17