Body: <p>Can I compare the Hitechnic block --> measure --> color output in a switch block? For example, if the Hitechnic color sensor is seeing black, then do something, else do another thing. If not, then how can I compare the values? The program I made takes the Hitechnic color sensor output and stores it in an array, so what I am trying to do is if the Hitechnic color sensor sees the same value (same color) stored at index 0 in the array do something. How can I accomplish this? (The Hitechnic color sensor stores different values in the array)</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-04-04T09:15:36.850Z
Comments.Text: Hi mohammed! Although I'm not familiar with this particular brand of sensor, but based on your description you can already store the read value in an array. This means you have the value in hand and therefore can perform arbitrary arithmetic or logic on it, including comparing it to a given constant (the value received while the sensor sees something black) or seeing if the value is below or above a given level (what you would consider as black). 
  
  If you need more help please specify the problem you are facing. Providing the source code could also let us help you more effectively.
Comments.UserDisplayName: zovits
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-04-04T12:21:18.870Z
Comments.Text: I would sure use your help . how can I contact you ?
Comments.UserDisplayName: mohammed ashoor
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-04-04T12:30:32.367Z
Comments.Text: As you seem to be unfamiliar with this site I'd recommend reading the Help section, accessible via the ? symbol in the upper right corner. In a nutshell: on this site people can ask their questions and other visitors to the site can answer them. None of us is obliged to do this, but we all do it to help the askers and to help anyone finding these questions later on. Therefore taking a discussion off-site is very much contrary to all our efforts here. You can either edit your question to incorporate any additional details or use the comment feature to do so.
Comments.UserDisplayName: zovits
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-04-04T12:51:46.570Z
Comments.Text: oh ok . I would like to thank you for your help, your comment really cleared things up for me . but I would to ask one more question please .should I use a compare block that is set to equal to and has the first input set as the current sensor reading and the second input set as index 0 in the array and take the output and insert it in a switch block that is set to logic ?
Comments.UserDisplayName: mohammed ashoor
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-04-04T12:58:59.567Z
Comments.Text: also how can I use the hitechnic color sensor block with a loop . I want the robot to do something until the hitechnic color sensor sees one of the colors in the list . how can I make a list that has a bunch of colors so I can use it in the loop block
Comments.UserDisplayName: mohammed ashoor
Tags: <ev3><programming><sensor-colour>
Title: Using switch block with Hitechnic color block
UserDisplayName: mohammed ashoor
ThreadText: # Using switch block with Hitechnic color block
  
  (Asked by: username_0 on 2019-04-03)
  
  Can I compare the Hitechnic block --> measure --> color output in a switch block? For example, if the Hitechnic color sensor is seeing black, then do something, else do another thing. If not, then how can I compare the values? The program I made takes the Hitechnic color sensor output and stores it in an array, so what I am trying to do is if the Hitechnic color sensor sees the same value (same color) stored at index 0 in the array do something. How can I accomplish this? (The Hitechnic color sensor stores different values in the array)
  
  **Tags:** ev3, programming, sensor-colour
  
  > **Comments:**
  > **username_1**: Hi username_0! Although I'm not familiar with this particular brand of sensor, but based on your description you can already store the read value in an array. This means you have the value in hand and therefore can perform arbitrary arithmetic or logic on it, including comparing it to a given constant (the value received while the sensor sees something black) or seeing if the value is below or above a given level (what you would consider as black).   If you need more help please specify the problem you are facing. Providing the source code could also let us help you more effectively.  
  > **username_0**: I would sure use your help . how can I contact you ?  
  > **username_1**: As you seem to be unfamiliar with this site I'd recommend reading the Help section, accessible via the ? symbol in the upper right corner. In a nutshell: on this site people can ask their questions and other visitors to the site can answer them. None of us is obliged to do this, but we all do it to help the askers and to help anyone finding these questions later on. Therefore taking a discussion off-site is very much contrary to all our efforts here. You can either edit your question to incorporate any additional details or use the comment feature to do so.  
  > **username_0**: oh ok . I would like to thank you for your help, your comment really cleared things up for me . but I would to ask one more question please .should I use a compare block that is set to equal to and has the first input set as the current sensor reading and the second input set as index 0 in the array and take the output and insert it in a switch block that is set to logic ?  
  > **username_0**: also how can I use the hitechnic color sensor block with a loop . I want the robot to do something until the hitechnic color sensor sees one of the colors in the list . how can I make a list that has a bunch of colors so I can use it in the loop block  
  
  ---
  
  ## 0 answers
  
  