No announcement yet.

how to look for a range of values using a color sensor

  • Filter
  • Time
  • Show
Clear All
new posts

  • how to look for a range of values using a color sensor

    When we use the color sensor we have troubles finding the white line on the field. How can we look for a specific range of values for example, hue between 90-120.

  • #2
    Here is an App Inventor project that looks for a hue between 90-120.

    However, if you are trying find something white, it would probably be better to look for saturation close to 0.
    Here is an App Inventor Project that looks for saturation less than 0.1.


    • #3
      Comrade, where are you supposed to go to through the links that you posted because they don't show me any programs


      • #4
        When you click them, do you see the Download icon at the upper right of the screen? Click that. It will download a .aia file. Then, in App Inventor choose the menu "Projects" -> "Import project (.aia) from my computer..."

        That will upload the project into your instance of App Inventor.


        • #5
          Some questions from my son:

          #1. Hello. I followed your program, but when the sensor reads any color, the app says "Clear: 1.0" "Red:1.0" and the rest is "~~~:0.0," even when the blue beacon is right next to the sensor. When the beacon is blue, the app displays "Clear:1.0" "Red:1.0" "Blue:0.0"

          #2. Also, is there a way to incorporate the code into having the robot move, and stop when it sees white? Thanks!