FlashLED 强度控制 [英] FlashLED intensity controls

查看:34
本文介绍了FlashLED 强度控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻求 Android 相机 LED 闪光灯的帮助,以改变它的强度,例如 这个应用.

I am looking for help in Android camera LED Flash for changing intensity of it like this app.

我已经检查了以下链接,但我没有从中得到确切的结果.

I have checked following link but i am not getting exact result from it.

  1. 我可以更改 Android 的 LED 强度吗设备?
  2. 如何在 Android 中以编程方式打开相机闪光灯?
  3. http://code.google.com/p/droidled/source/checkout
  4. http://code.google.com/p/simpleled/source/checkout
  5. https://code.google.com/p/openintents/source/checkout

而且我无法执行 此链接(对我来说似乎很有希望).

And I am not able to execute this link (it seems promising to me).

非常感谢任何帮助.

推荐答案

找到答案 这里

HTC 有一个支持此功能的替代 API,但它仅适用于 HTC Sense 设备,并且从 Gingerbread 开始,他们更改了权限,因此仅适用于他们的手电筒应用程序,而不适用于第三方应用程序(除非您使用 root).

HTC has an alternative API that supports this, however it's only on HTC Sense devices, and as of Gingerbread they've changed the permissions so it's only for their Flashlight app, not third party ones (unless you use root).

但在 2.2 HTC 设备上,您可以通过将字符串写入 /sys/devices/platform/flashlight.0/leds/flashlight/brightness 来使用它.这控制 LED 是否打开以及它的亮度.最大亮度写"128\n",半亮度写"64\n".易于从 adb shell 进行测试:

But on 2.2 HTC devices you can use it by writing a string to /sys/devices/platform/flashlight.0/leds/flashlight/brightness. This controls if the LED is on and how bright it is. For maximum brightness write "128\n", half brightness write "64\n". Easy to test from adb shell:

echo "128" > /sys/devices/platform/flashlight.0/leds/flashlight/brightness

最后通过在那里写入 "0\n" 来关闭它.

And finally turn it off by writing "0\n" there.

这篇关于FlashLED 强度控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆