Comments (3)
Hi Marshall,
Could you please double check that the wiring of the sensor is correct? What is the I2C address of your sensor?
I am using a cheap TSL2561 sensor module that I bought from ebay. After attaching it to Raspberry Pi I can see the sensor as:
pi@raspberrypi:~/rpi-examples $ i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- 39 -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
After that the usage of the examples is straight-forward. The second example uses library wiringPi:
pi@raspberrypi:~/rpi-examples $ cd TSL2561/c/example
example/ example-wiringpi/
pi@raspberrypi:~/rpi-examples $ cd TSL2561/c/example
example/ example-wiringpi/
pi@raspberrypi:~/rpi-examples $ cd TSL2561/c/example/
pi@raspberrypi:~/rpi-examples/TSL2561/c/example $ make
gcc -c -o TSL2561.o TSL2561.c -I.
gcc -c -o TSL2561_test.o TSL2561_test.c -I.
gcc -o TSL2561_test TSL2561.o TSL2561_test.o -I.
pi@raspberrypi:~/rpi-examples/TSL2561/c/example $ sudo ./TSL2561_test
Test. RC: 0(Success), broadband: 80, ir: 13, lux: 8
pi@raspberrypi:~/rpi-examples/TSL2561/c/example $ cd ..
pi@raspberrypi:~/rpi-examples/TSL2561/c $ cd example-wiringpi/
pi@raspberrypi:~/rpi-examples/TSL2561/c/example-wiringpi $ make
gcc -c -o TSL2561.o TSL2561.c -I.
gcc -o TSL2561 TSL2561.o -I. -lwiringPi
pi@raspberrypi:~/rpi-examples/TSL2561/c/example-wiringpi $ sudo ./TSL2561
Lux: 10
Best regards, Leon
from rpi-examples.
Good morning Leon,
Well, this is a little embarrassing, but I didn't want to just leave you hanging - it turns out that the device I've been working with is actually the TCS34725, not the TSL2561 at all! When I used the appropriate code for the device - everything works as it should! Sorry for the confusion!
Just the same, my thanks to you for the code I did successfully use for the HTU21D-F, not to mention your response above. Have a great day!
Sincerely,
Marshall
from rpi-examples.
Hi Marshall,
Thank you for the feedback and no worries. Btw feel free to add an example about TCS34725 to this project. I will be more than happy to review and merge a GitHub pull request with such an example :)
Best regards, Leon
from rpi-examples.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rpi-examples.