Advanced search FAQ Register Login

It is currently Sun Jan 21, 2018 1:35 am

 

Postby Coen » Tue Jan 12, 2016 6:23 pm

BMS Doug wrote:
Great pictures, the connections are correct.
you need to copy the files onto the pi and run them on the Pi, specifically you want to run Adafruit_TCS34725_Example.py

Code: Select all

sudo python Adafruit_TCS34725_Example.py

but you need all three python files to be present in the same directory in the Pi as the example python program imports code from the other two programs.

If you follow these instructions from adafruit it will download all of the adafruit sample code for the raspberry pi, then you just need to change your working directory so that you are in the TCS34725 sub directory and run the code as described above.

Code: Select all

cd /Adafruit-Raspberry-Pi-Python-Code/Adafruit_TCS34725

Code: Select all

sudo python Adafruit_TCS34725_Example.py


I hope this helps.


Okay thanks! We'll try out soon

Coen
n00b

Posts: 7

Joined: Wed Nov 04, 2015 7:31 pm

Location: Netherlands

Postby BMS Doug » Fri Jan 22, 2016 5:49 pm

I hope that the lack of further replies means that you have got your colour sensor working.

Either way, please let us know your progress.

BMS Doug
31337

Posts: 273

Joined: Tue Sep 08, 2015 3:55 pm

Location: London

Doug.

Volunteer Moderator.

Postby Coen » Sun Jan 24, 2016 2:12 pm

BMS Doug wrote:I hope that the lack of further replies means that you have got your colour sensor working.

Either way, please let us know your progress.


We've started working on it today but we have some errors when we try to run that example.

Code: Select all

on Adafruit_TCS34725_Example.py
Traceback (most recent call last):
  File "Adafruit_TCS34725_Example.py", line 11, in <module>
    tcs = TCS34725(integrationTime=0xEB, gain=0x01)
  File "/home/pi/Adafruit-Raspberry-pi-python-Code/Adafruit_TCS34725/Adafruit_TCS34725.py", line 100, in __init__
    self.i2c = Adafruit_I2C(address)
  File "/home/pi/Adafruit-Raspberry-pi-python-Code/Adafruit_TCS34725/Adafruit_I2C.py", line 35, in __init__
IOError: [Errno 2] No such file or directory


Help?

EDIT: We just managed to solve the above problem, however, we ran into another problem.
When we try to run the command

Code: Select all

sudo python  Adafruit_TCS34725_Example.py
we get the following error

Code: Select all

Error accessing 0x29: Check your I2C address
.
Any suggestions?

EDIT: After soldering the Colour Sensor everything is working now, Thanks for the help Doug.

Coen
n00b

Posts: 7

Joined: Wed Nov 04, 2015 7:31 pm

Location: Netherlands

Postby BMS Doug » Wed Jan 27, 2016 5:51 pm

I'm glad that you got it working.

BMS Doug
31337

Posts: 273

Joined: Tue Sep 08, 2015 3:55 pm

Location: London

Doug.

Volunteer Moderator.
Previous

Who is online

Users browsing this forum: No registered users and 1 guest

Board index

The teamDelete all board cookies • All times are UTC [ DST ]