I need help! Boebot and home-made color sensor
Hello!
I've built a home-made color sensor.
This sensor consists of three LEDs and one LDR. The sensor have to recognise three cubes of different color . Depending of the color of the cubes, the light that returns to the LDR is different, then the resistance that the LDR has is different in every colour.
I think that the sensor will work well, but I don't know how to do in order that the boebot admit the resistance that has the LDR and admit what colour it is.
Can anyone help me ?
Sorry if my english is not very good. Regards from Barcelona !
I've built a home-made color sensor.
This sensor consists of three LEDs and one LDR. The sensor have to recognise three cubes of different color . Depending of the color of the cubes, the light that returns to the LDR is different, then the resistance that the LDR has is different in every colour.
I think that the sensor will work well, but I don't know how to do in order that the boebot admit the resistance that has the LDR and admit what colour it is.
Can anyone help me ?
Sorry if my english is not very good. Regards from Barcelona !
Comments
Where I've to connect the LDR to the boebot ?
The boebot shows the resistance of the LDR inmediately ?
It's possible to say to the BoeBot "If the resistance is X say "Blue"" or "If the resistance is Y say "Red"" ??
Thanks!
This manual is available in Spanish (www.parallax.com/tabid/535/Default.aspx). Also read the Spanish translation of "What's a Microcontroller?".
Post Edited (Mike Green) : 7/20/2008 7:35:43 PM GMT
I've done the RCTIME circuit, and now the BoeBot says the resistance numbers.
But I don't know how to do the decision making.
When you want to make a decision, you put "IF condition THEN instruction". What I've to put instead of "condition" ?
Thanks a lot!
Post Edited (Eduard) : 8/8/2008 9:31:58 PM GMT
perhaps it would be easiest to get it working with on LED first and then add them as needed.
just my .02¢
added:
David Cook talks about this project on the link below, but he doesn't use a Stamp.
http://www.robotroom.com/ColorSensor.html
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"A complex design is the sign of an inferior designer." - Jamie Hyneman, Myth Buster
DGSwaner
Post Edited (Dgswaner) : 8/8/2008 10:57:02 PM GMT
Here in the photo you can see my sensor. It consists of 3 LDR (Red, Green and Blue) and in the center, one LDR.
The program is like this:
Sensor:
Led Blue On
analyze (A)
Led Blue off
Led Red On
analyze (B)
Led Red Off
Led Green On
analyze (C)
Led Green Off
IF A>5 , B>10 C<67 THEN yellow
IF A<7 , B>2 C<13 THEN black
IF A<5 , B<10 C<12 THEN grey
Sorry, but I'm a begginer with this , and I'm confused
How can I say to the boebot that it has to make a decision with the results of the RCTIME ?
Thanks a lot !!
I want to differ three different colours. To differentiate them I use three leds and one LDR that has to make three differents measurements using RCTIME (A, B and C, for example) .
I want that the boe-bot analyze the A, B and C measurements and depending on the results, recognise the colour of the object.
Is it possible ?
Thanks!! [noparse]:)[/noparse]
I can differ between three different colurs : Yellow, Black and Purple.
But I've done a trap...
I was having a problem... "Constant exeeds 16 bits". Then, I erased the three last numbers of each result, and now it works perfectly...
YELLOW in catalan is GROC
PURPLE in catalan is LILA
BLACK in catalan is NEGRE
Thanks!
how that code work ? could you post the code?