Loading...
Pages: 1 [2]   Go Down
Author Topic: HDJD-S822 Color Sensor Code?  (Read 1012 times)
0 Members and 1 Guest are viewing this topic.
Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 313
Posts: 35507
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
what should i do to make it better?
Now, we know what sensor you are using, but not how you have connected it to the Arduino. Feel free to volunteer any other info we might need, too.
Logged

Sulaymaniyah-Kurdistan
Offline Offline
Jr. Member
**
Karma: 0
Posts: 89
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i just connected by jumber wire and breadboard
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 313
Posts: 35507
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
i just connected by jumber wire and breadboard
Well, that's certainly enough detail to be sure that you wired it correctly. The only other thing I can think of then is that maybe you should have used duct tape.
Logged

UK
Offline Offline
Tesla Member
***
Karma: 89
Posts: 6388
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You could just check for the red, green and blue intensities being similar to the figures you get from the paper samples.

For example:
Code:
if((red < 150) && (green > 100) && (green < 200) && (blue > 200))
{
   Serial.println("Red");
}

The RGB values you describe don't seem to correspond to the colour of the paper that you say produced them so you probably have your sensor wired incorrectly or the channels swapped over, but since you seem to be getting consistent values for a given colour you can use those to tell when that colour is present.
Logged

Sulaymaniyah-Kurdistan
Offline Offline
Jr. Member
**
Karma: 0
Posts: 89
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks for all replay but i have a question about the range
does anyone know more about this sensor technically??
Logged

Sulaymaniyah-Kurdistan
Offline Offline
Jr. Member
**
Karma: 0
Posts: 89
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Please some answers?
Logged

Sulaymaniyah-Kurdistan
Offline Offline
Jr. Member
**
Karma: 0
Posts: 89
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i try again but it still give's wrong value while i did the wire connection better?
Please anyone help me!
Logged

Pages: 1 [2]   Go Up
Print
 
Jump to: