我可以更改Android设备的LED亮度? [英] Can I change the LED intensity of an Android device?

查看:310
本文介绍了我可以更改Android设备的LED亮度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法来设置LED亮度是我的愿望?我知道打开我用的是LED:

Is there a way to set the LED intensity that I desire? I know that to turn on the LED I use:

     p.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH);
     mycam.setParameters(p);

但是,这code刚刚打开的LED。但是,有没有一种方法来设置不同强度的LED为一个更强的光或者减少光照强度?

But this code just turns on the LED. But is there a way to set different intensities to the LED for a stronger light or to reduce the light intensity?

推荐答案

HTC有支持此替代的API,但它只有在HTC Sense装置,并作为姜饼,他们已经改变了权限,因此,这只是他们的手电筒应用程序,没有第三方的人(除非你使用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。易亚行外壳测试:

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那里。

这篇关于我可以更改Android设备的LED亮度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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