led

Fading Arduino RGB LED from one color to the other?

╄→гoц情女王★ 提交于 2019-12-20 10:10:58
问题 I've currently managed to get my LED to cycle through eight colors that I've selected. Everything is working correctly, except that I want to go for a more natural feel, and would like to fade / transition from one color to the next, instead of having them just replace one another. Here's my code so far: int redPin = 11; int greenPin = 10; int bluePin = 9; void setup() { pinMode(redPin, OUTPUT); pinMode(greenPin, OUTPUT); pinMode(bluePin, OUTPUT); } void loop() { setColor(250, 105, 0); //

Finding distance to an LED

[亡魂溺海] 提交于 2019-12-19 11:38:08
问题 Imagine you have Christmas-tree style LED light at a distance D from a camera. Knowing the properties of both the LED light (such as shape and intensity) and the camera (such as focal length), is it possible to calculate the distance from the camera to the LED light using a snapshot? If yes, how accurate would the measurement be? 回答1: Bright light sources itself are not good for this as the bright light usually distorts the neighboring space with MIE+Rayleight scattering creating haze

Android How to blink led/flashlight rapidly

寵の児 提交于 2019-12-19 11:27:23
问题 I am trying to give some effects with led/flashlight. but it is not blinking rapidly, even i tried sleep(2), bt it takes time to blink. i want to blink it faster. public void flash_effect() throws InterruptedException { cam = Camera.open(); final Parameters p = cam.getParameters(); p.setFlashMode(Parameters.FLASH_MODE_TORCH); Thread a = new Thread() { public void run() { for(int i =0; i < 10; i++) { cam.setParameters(p); cam.startPreview(); try { Thread.sleep(50); } catch

Can the Android handset LED be manipulated without using a Notification object?

a 夏天 提交于 2019-12-17 20:05:40
问题 I want to control the LED on an Android device with more control than is offered by the Notification class. Notifications allow you to change the rate of flashing; e.g. 300 milliseconds on, 1000 milliseconds off, but that's it. Essentially, I would like to turn the LED on and off at will at arbitrary times. Does anyone know if this is possible? The API does not seem to say so. Does it depend on the specific hardware? 回答1: I haven't tried this in code, but the SDK shows this: To turn the LED

Disable/enable notification led

帅比萌擦擦* 提交于 2019-12-17 19:05:00
问题 Is it possible to programmatically disable and enable the led indicator light on an Android device? I am not referring to just turning it on and off as in a notification. I did not see anything in the api that would do so. I am guessing this is hardware specific if it is possible at all. 回答1: I have not seen any APIs for dealing with the LEDs other than the Notification class. 回答2: Yea sure there is a way... android.provider.Settings.System.putInt(getContentResolver(), "notification_light

Individual Access of Camera LED Lights of iPhone 5s

怎甘沉沦 提交于 2019-12-17 18:14:27
问题 I'm coding for the iPhone 5s and it now has two LED lights for the rear camera. I don't know the official LED color names, but one LED is white and the other LED is yellowish. Apple refers to this as "True Tone". I'm trying to access these camera LED lights individually. I believe this to be possible because when I access iOS7's control center (swipe up from bottom) and press the built-in flash light, only the white LED comes on. This is different from applying the torch light code below.

How to use camera flash/led as torch on a Samsung Galaxy Tab?

ⅰ亾dé卋堺 提交于 2019-12-17 10:23:57
问题 I'm facing to a problem with a Samsung Galaxy Tab. I want to use the camera flash as torch. Does anyone know how to enable it ? Hereby a code that works to enable/disable the camera flash on a HTC Desire but fails on Samsung Galaxy Tab. FlashLight.java : package com.example.FlashLight; import android.app.Activity; import android.hardware.Camera; import android.hardware.Camera.Parameters; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.View

Can I change the LED intensity of an Android device?

安稳与你 提交于 2019-12-17 05:54:07
问题 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); 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? 回答1: 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

Can I change the LED intensity of an Android device?

ぃ、小莉子 提交于 2019-12-17 05:54:05
问题 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); 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? 回答1: 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

LED flashlight on Galaxy Nexus controllable by what API?

岁酱吖の 提交于 2019-12-17 03:08:15
问题 So many LED flashlight API questions for Android. I'm afraid to ask yet another, but here goes.. Using the tried and true FLASH_MODE_TORCH I am able to achieve satisfaction with my Samsung Galaxy SII and get the LED flash turned on. On my friend's Galaxy Nexus, no such luck. Nor on my other friend's Droid X. I'm noticing for a not insignificant number of devices specific native IOCTL calls seem to be required. Is this the case for the Galaxy Nexus? How do I find a reference to program it? I