Questions tagged [light-sensor]
41 questions
3
votes
1 answer
How to solve "ValueError: The channel sent is invalid on a Raspberry Pi" error?
I have a python code to get readings from a light sensor. I have upgraded the raspberry pi too. But when I tried to execute the code it gives me an error as follows
Here is my python code
#!/usr/local/bin/python
import RPi.GPIO…

Joe
- 45
- 1
- 9
2
votes
1 answer
Android light sensor array data
In the Android developer guide, when dealing with the light sensor, it says:
// The light sensor returns a single value.
// Many sensors return 3 values, one for each axis.
And then proceeds to take the first value of the array:
float lux =…

scf
- 396
- 2
- 19
2
votes
1 answer
trying to read light sensor using i2c & bcm2835 on RPI - TSL2561
My brother and I have been trying to get this working for days now and we just can't figure out what we are doing wrong, we could really use some help please!
What we're trying to accomplish is reading in data from a light sensor on an RPI expansion…

Yannick.D
- 51
- 7
2
votes
1 answer
Finch Light Sensors as Pretest condition for Obstacle Avoidance
I am trying to create a basic obstacle avoidance behavior, but I want it to only function if the light sensors are over a certain value.
while (!myFinch.isBeakDown())
{
myFinch.getLeftLightSensor();
light = myFinch.getLeftLightSensor();
…

residentburge
- 21
- 2
2
votes
3 answers
Android Light Sensor to detect significant light change
I am trying to use Sensor.Type_Light or the Light Sensor to detect change in event.values[0].
@Override
public void onSensorChanged(SensorEvent event) {
if (event.sensor.getType()== Sensor.TYPE_LIGHT) {
debugView =…

asdec90
- 1,070
- 2
- 13
- 28
1
vote
2 answers
How is the value in a BH1750 light sensor assigned using a shifting operator <
I'm using a BH1750 light sensor with arduino to display the lux values on an LCD. But in the code, I'm unable to get the formula. Can anybody explain me the formula?
I tried to find it in the datasheet of BH1750, but I was not able to understand…

Abhishek Sharma
- 11
- 1
1
vote
0 answers
Time.sleep() zeroes photo resistor readings on Raspberry Pi
I have a Raspberry Pi 3 and a photoresistor, LEDs, resistors, breadboard etc. Now, I have observed a strange occurrence. When I run the following code all of the readings from the light sensor are zeroed.
import RPi.GPIO as GPIO
from time import…

Anonymous Coder
- 512
- 1
- 6
- 22
1
vote
3 answers
Reading iOS light sensor with ARKit
Is there a way to access the ambient light sensor of an iOS device, using the ARKit, without using the AR at all?
https://developer.apple.com/documentation/arkit/arlightestimate/2878308-ambientintensity
In other words, can I access the value of…

Denis T
- 13
- 1
- 4
1
vote
0 answers
Get LUX value for Cordova app
I'm implementing a Cordova App for Android and iOS. I want to get the LUX (illuminance) value.
I'm not sure if my phone has a device light sensor (or do all smart phones have them these days?) - I tried "window.ondevicelight" but it wasn't…

user3647967
- 75
- 1
- 5
1
vote
0 answers
Android light sensor not detecting light surrounding properly
I was having some problem when trying to do a light sensor for Android application. Here is my code:
@Override
protected void onCreate(Bundle savedInstanceState) {
sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
Sensor…

QWERTY
- 2,303
- 9
- 44
- 85
1
vote
1 answer
Howto create vim bundle to switch theme depending on webcam light measurement
I have seen several tricks to switch vim theme depending on the time of day, but I want to switch depending on the light in the room and thought that maybe I could use the webcam. Has anyone seen such a vim bundle?
If I where to take an image with…

tirithen
- 3,219
- 11
- 41
- 65
1
vote
1 answer
Can android acquire light frequency using light sensor? How?
Can android acquire light frequency using light sensor? If so, how?

Asher
- 53
- 5
1
vote
1 answer
Using light events in JavaScript
I am confused by the documentation I'm reading here:
https://developer.mozilla.org/en-US/docs/WebAPI/Using_Light_Events
How do I get the light intensity of the event?

James Bennett
- 10,903
- 4
- 35
- 24
0
votes
0 answers
Arduino IR flying-fish sensor not working
I need to use the IR flying-fish sensor as an essential part of my school project and I need it to check when there is a reflective tape over it. I built a circuit for it and programmed it accordingly, allowing it to compile. The green LED lights up…

Itay Lador
- 313
- 1
- 10
0
votes
0 answers
Can you give me all the components for building the fastest intelligent Tracking car
Can you give me all the components for building the fastest intelligent Tracking car, but in a small size with a w and h of not more than 25 cm?
use only 2 sensor
and 2 motor for controll wheel
and robot is not controlled by a microcontroller, and…