Color Sensor not working!


#1

Hi guys !

I have a project to do with the brickpi and i tryed the ColorSensor exemple in Python ! It didn’t work ! it only says
black
black
black
black

So i was wondering if the type of sensor i use is OK with the brickpi

my sensor: http://www.amazon.com/LEGO-4297099-Mindstorms-Light-Sensor/dp/B000PLYTG0

merci !


#2

Hey Mignam,

This is not the color sensor, this is a light sensor. It requires different code. You should be able to run the python example for analog sensors, I think, and be able to read light intensity. But you won’t be able to read colors with that sensor.

John


#3

lol ok i admit…i didn’t expect that… thank you !

but i still have a problem, Python code is working but i would like to test C code.

All of your examples returns the same error:
–BrickPiSetupSensors -1

Except for LED.c

i’m testing on 2 different brickPi and with 2 DexterIndusties Image… Still not working…

i already post on forum about it and some of them have the same problem but we can’t find any solution !:wink:

Thank you for your help !:wink:


#4

Sorry this has lingered so long. I think the issue you’re facing is answered here:
http://www.dexterindustries.com/forum/?topic=errors-running-lego-motor-test-c

Karan answered it here:

We think we have a solution to the the BrickPi C code problem. The way to make it work is to update the packages and the run the BrickPi setup script again. Also make sure that you have the latest C code too.

We have put together an install script that should help you with this. Here’s the link: https://github.com/DexterInd/BrickPi_C/tree/master/Scripts .

Download it and follow the Readme and the C code should work for you.
-Karan


#6