|
Post by Eric on Nov 11, 2017 21:55:43 GMT -8
Hello,
I'm a bit new to this, so sorry if this is a simple mistake.
I am trying to get the sunlight sensor to work. When i do the .readVisible(), .readIR(), and .readUV(), they all give me a value of zero. I followed the instructions to download the correct .py files and I import them correctly. Am I missing something?
CODE in python:
import time import SDL_Pi_SI1145
sensor = SDL_Pi_SI1145.SDL_Pi_SI1145() while True: print(sensor.readVisible()) print(sensor.readIR()) print(sensor.readUV()) print() time.sleep(3)
|
|
|
Post by SDL on Nov 12, 2017 12:30:09 GMT -8
Hi Eric,
Could be an I2C address conflict. Do you have anything else on the I2C bus?
What else is connected to your Pi?
Also, please post the results from this: "i2cdetect -y 1"
Make sure you have enabled the I2C bus on the Raspberry Pi! It comes disabled by default (rasps-config will do it for you)
BP
|
|
|
Post by Eric on Nov 14, 2017 11:43:48 GMT -8
Nothing else is connect to the raspberry pi except for a keyboard, mouse, and the display. Only the sunlight sensor.
pi@raspberrypi:~ $ i2cdetect -y 1 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --
Thank you for your response.
|
|
|
Post by SDL on Nov 14, 2017 15:39:50 GMT -8
Eric,
I'll use your code above and try to reproduce it in the lab.
BP
|
|
|
Post by Eric on Nov 14, 2017 20:29:27 GMT -8
Thank you
|
|
|
Post by Eric on Nov 19, 2017 22:54:43 GMT -8
Any updates?
|
|
|
Post by SDL on Nov 20, 2017 8:37:01 GMT -8
We haven't done the work yet. Should get to it this week.
BP
|
|