I’m trying to use the ISL29125 RBG sensor for a line following project. I can’t figure how to take the sensor reading and apply it in an if statement. The ISL29125_basics.ino works fine to print out the color values which are what would be used in the if statement. I just don’t know how to get that value into the if statement. Any help would be appreciated.
Chuck
Hi Chuck,
We cannot really help too much with custom code/debugging, but we would be happy to try and point you in the right direction. I would recommend starting by referring to our examples for our [RedBot Line Follower Breakout and [Line Follower Array.
These use an IR sensor’s input to follow a simple black line but they should give you some hints as to the basic structure of your if statements in your code. I hope this helps you get started with this code. Let us know if you have any other questions or concerns about the RGB Sensor and we would be happy to help as much as we can.](SparkFun_Line_Follower_Array_Arduino_Library/examples/MostBasicFollower/MostBasicFollower.ino at master · sparkfun/SparkFun_Line_Follower_Array_Arduino_Library · GitHub)](SparkFun_RedBot_Arduino_Library/examples/Exp6_2_LineFollowing_IRSensors/Exp6_2_LineFollowing_IRSensors.ino at master · sparkfun/SparkFun_RedBot_Arduino_Library · GitHub)