SPIKE color sesnor keeps report green when see half black line #1760
Answered
by
laurensvalk
shihhaoyang
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
laurensvalk
Aug 15, 2024
Replies: 1 comment 1 reply
-
The code you're showing looks good, I think. When you change that loop to just print the colors, does it give you the correct result? In other words, were both of your pictures above taken with the robot in the same place? Can you try setting the S value for black and white to 0? And perhaps increase the S value for green a bit. This should make it less likely to report green when it isn't seeing it. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
shihhaoyang
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The code you're showing looks good, I think.
When you change that loop to just print the colors, does it give you the correct result? In other words, were both of your pictures above taken with the robot in the same place?
Can you try setting the S value for black and white to 0? And perhaps increase the S value for green a bit. This should make it less likely to report green when it isn't seeing it.